Skip to content

Commit e7e51dc

Browse files
committed
fix: wrong keys on inspector selector buttons
1 parent 09ee8b2 commit e7e51dc

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

packages/app-frontend/src/features/header/AppHeader.vue

+13-4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import AppHeaderSelect from './AppHeaderSelect.vue'
77
import AppMainMenu from './AppMainMenu.vue'
88
99
import { computed, ref, watch, defineComponent } from '@vue/composition-api'
10+
import type { RawLocation, Route } from 'vue-router'
1011
import { BridgeEvents } from '@vue-devtools/shared-utils'
1112
import { useRoute } from '@front/util/router'
1213
import { useBridge } from '@front/features/bridge'
@@ -15,6 +16,14 @@ import { useTabs } from './tabs'
1516
import { showAppsSelector } from './header'
1617
import { useOrientation } from '../layout/orientation'
1718
19+
interface InspectorRoute {
20+
icon: string
21+
label: string
22+
targetRoute: RawLocation
23+
matchRoute: (route: Route) => boolean
24+
pluginId?: string
25+
}
26+
1827
export default defineComponent({
1928
components: {
2029
AppHeaderLogo,
@@ -32,14 +41,14 @@ export default defineComponent({
3241
3342
const { inspectors: customInspectors } = useInspectors()
3443
35-
const inspectorRoutes = computed(() => [
44+
const inspectorRoutes = computed(() => ([
3645
{
3746
icon: 'device_hub',
3847
label: 'Components',
3948
targetRoute: { name: 'inspector-components' },
4049
matchRoute: route => route.matched.some(m => m.name === 'inspector-components'),
4150
},
42-
].concat(customInspectors.value.map(i => ({
51+
] as InspectorRoute[]).concat(customInspectors.value.map(i => ({
4352
icon: i.icon || 'tab',
4453
label: i.label,
4554
pluginId: i.pluginId,
@@ -128,8 +137,8 @@ export default defineComponent({
128137
@update="route => $router.push(route.targetRoute)"
129138
>
130139
<VueGroupButton
131-
v-for="item of inspectorRoutes"
132-
:key="item.id"
140+
v-for="(item, index) of inspectorRoutes"
141+
:key="index"
133142
:value="item"
134143
:icon-left="item.icon"
135144
class="flat"

0 commit comments

Comments
 (0)