@@ -7,6 +7,7 @@ import AppHeaderSelect from './AppHeaderSelect.vue'
7
7
import AppMainMenu from ' ./AppMainMenu.vue'
8
8
9
9
import { computed , ref , watch , defineComponent } from ' @vue/composition-api'
10
+ import type { RawLocation , Route } from ' vue-router'
10
11
import { BridgeEvents } from ' @vue-devtools/shared-utils'
11
12
import { useRoute } from ' @front/util/router'
12
13
import { useBridge } from ' @front/features/bridge'
@@ -15,6 +16,14 @@ import { useTabs } from './tabs'
15
16
import { showAppsSelector } from ' ./header'
16
17
import { useOrientation } from ' ../layout/orientation'
17
18
19
+ interface InspectorRoute {
20
+ icon: string
21
+ label: string
22
+ targetRoute: RawLocation
23
+ matchRoute: (route : Route ) => boolean
24
+ pluginId? : string
25
+ }
26
+
18
27
export default defineComponent ({
19
28
components: {
20
29
AppHeaderLogo ,
@@ -32,14 +41,14 @@ export default defineComponent({
32
41
33
42
const { inspectors : customInspectors } = useInspectors ()
34
43
35
- const inspectorRoutes = computed (() => [
44
+ const inspectorRoutes = computed (() => ( [
36
45
{
37
46
icon: ' device_hub' ,
38
47
label: ' Components' ,
39
48
targetRoute: { name: ' inspector-components' },
40
49
matchRoute : route => route .matched .some (m => m .name === ' inspector-components' ),
41
50
},
42
- ].concat (customInspectors .value .map (i => ({
51
+ ] as InspectorRoute []) .concat (customInspectors .value .map (i => ({
43
52
icon: i .icon || ' tab' ,
44
53
label: i .label ,
45
54
pluginId: i .pluginId ,
@@ -128,8 +137,8 @@ export default defineComponent({
128
137
@update =" route => $router.push(route.targetRoute)"
129
138
>
130
139
<VueGroupButton
131
- v-for =" item of inspectorRoutes"
132
- :key =" item.id "
140
+ v-for =" ( item, index) of inspectorRoutes"
141
+ :key =" index "
133
142
:value =" item"
134
143
:icon-left =" item.icon"
135
144
class =" flat"
0 commit comments