Skip to content

Commit 84ee4a9

Browse files
committed
fix(components): expanding component tree not working
1 parent 9704dc4 commit 84ee4a9

File tree

1 file changed

+7
-6
lines changed
  • packages/app-frontend/src/features/components

1 file changed

+7
-6
lines changed

packages/app-frontend/src/features/components/index.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -261,18 +261,19 @@ export function setupComponentsBridgeEvents (bridge) {
261261

262262
// Handle tree data
263263
const data = parse(treeData)
264+
console.log('component tree:', data, instanceId)
264265
const instance = componentsMap[instanceId]
265266
if (instance) {
266-
for (const key in data) {
267-
Vue.set(instance, key, data[key])
267+
for (const item of data) {
268+
const component = componentsMap[item.id]
269+
for (const key in item) {
270+
Vue.set(component, key, item[key])
271+
}
272+
addToComponentsMap(component)
268273
}
269-
addToComponentsMap(instance)
270274
} else if (Array.isArray(data)) {
271275
rootInstances.value = data
272276
data.forEach(i => addToComponentsMap(i))
273-
} else {
274-
rootInstances.value = [data]
275-
addToComponentsMap(data)
276277
}
277278

278279
// Try to load selected component again

0 commit comments

Comments
 (0)