Skip to content

Commit e1e309a

Browse files
committed
chore(dev): fix example plugin
1 parent 10333f7 commit e1e309a

File tree

1 file changed

+8
-6
lines changed
  • packages/shell-dev-vue3/src/devtools-plugin

1 file changed

+8
-6
lines changed

packages/shell-dev-vue3/src/devtools-plugin/index.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,14 @@ export default {
2222
let time = 0
2323

2424
api.on.walkComponentTree((payload, ctx) => {
25-
if (payload.componentInstance.type.name === 'MyApp') {
26-
payload.componentTreeData.tags.push({
27-
label: 'root',
28-
textColor: 0x000000,
29-
backgroundColor: 0xFF984F
30-
})
25+
for (const node of payload.componentTreeData) {
26+
if (node.name === 'MyApp') {
27+
node.tags.push({
28+
label: 'root',
29+
textColor: 0x000000,
30+
backgroundColor: 0xFF984F
31+
})
32+
}
3133
}
3234
})
3335

0 commit comments

Comments
 (0)