File tree Expand file tree Collapse file tree 3 files changed +38
-1
lines changed
app-frontend/src/features/inspector/custom
shell-dev-vue3/src/devtools-plugin Expand file tree Collapse file tree 3 files changed +38
-1
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,13 @@ export interface CustomInspectorNode {
42
42
id : string
43
43
label : string
44
44
children ?: CustomInspectorNode [ ]
45
+ tags ?: CustomInspectorNodeTag [ ]
46
+ }
47
+
48
+ export interface CustomInspectorNodeTag {
49
+ label : string
50
+ textColor : number
51
+ backgroundColor : number
45
52
}
46
53
47
54
export interface CustomInspectorState {
Original file line number Diff line number Diff line change @@ -85,6 +85,18 @@ export default {
85
85
<span >
86
86
{{ node.label }}
87
87
</span >
88
+
89
+ <span
90
+ v-for =" (tag, index) of node.tags"
91
+ :key =" index"
92
+ :style =" {
93
+ color: `#${tag.textColor.toString(16).padStart(6, '0')}`,
94
+ backgroundColor: `#${tag.backgroundColor.toString(16).padStart(6, '0')}`,
95
+ }"
96
+ class =" tag px-1 rounded-sm ml-2"
97
+ >
98
+ {{ tag.label }}
99
+ </span >
88
100
</div >
89
101
90
102
<div v-if =" expanded && node.children" >
@@ -97,3 +109,9 @@ export default {
97
109
</div >
98
110
</div >
99
111
</template >
112
+
113
+ <style lang="postcss" scoped>
114
+ .tag {
115
+ font-size : 0.65 rem ;
116
+ }
117
+ </style >
Original file line number Diff line number Diff line change @@ -69,7 +69,19 @@ export default {
69
69
children : [
70
70
{
71
71
id : 'child' ,
72
- label : `Child ${ payload . filter } `
72
+ label : `Child ${ payload . filter } ` ,
73
+ tags : [
74
+ {
75
+ label : 'active' ,
76
+ textColor : 0x000000 ,
77
+ backgroundColor : 0xFF984F
78
+ } ,
79
+ {
80
+ label : 'test' ,
81
+ textColor : 0xffffff ,
82
+ backgroundColor : 0x000000
83
+ }
84
+ ]
73
85
}
74
86
]
75
87
}
You can’t perform that action at this time.
0 commit comments