Skip to content

Commit

Permalink
fix: route record type
Browse files Browse the repository at this point in the history
  • Loading branch information
kingyue737 committed Jul 28, 2024
1 parent 26a0574 commit 3dbb890
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/layout/AppDrawerItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,16 @@ const visibleChildrenNum = computed(() => visibleChildren.value?.length || 0)
const isItem = computed(() => !item.children || visibleChildrenNum.value <= 1)
const title = toRef(() => item.meta?.title)
const icon = toRef(() => item.meta?.icon)
// @ts-expect-error unknown type miss match
const to = computed<RouteRecordRaw>(() => ({
name: item.name || visibleChildren.value?.[0].name,
}))
</script>

<template>
<v-list-item
v-if="isItem && icon"
:to="{ name: item.name || visibleChildren?.[0].name }"
:to="to"
:prepend-icon="icon"
active-class="text-primary"
:title="title"
Expand Down
1 change: 1 addition & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export default defineConfig({
VueRouter({ importMode: 'sync', dts: './src/typed-router.d.ts' }),
Vue({
template: { transformAssetUrls },
features: { propsDestructure: true },
}),
Layouts(),
Vuetify({ autoImport: true }),
Expand Down

0 comments on commit 3dbb890

Please sign in to comment.