类型优化

This commit is contained in:
Gary Fu
2024-01-07 13:05:05 +08:00
parent b4cf4963b8
commit 8999253e3f
15 changed files with 311 additions and 117 deletions

View File

@@ -1,6 +1,6 @@
<script setup>
import { computed } from 'vue'
import { filterMenus } from '@/components/utils'
import { filterMenus, useParentRoute } from '@/components/utils'
import { useRoute } from 'vue-router'
const props = defineProps({
@@ -13,7 +13,8 @@ const menuItems = computed(() => {
return filterMenus(props.menus)
})
const activeRoutePath = computed(() => {
const route = useRoute()
let route = useRoute()
route = useParentRoute(route)
return route && route.path !== '/' ? route.path : ''
})
</script>