mirror of
https://github.com/fugary/simple-element-plus-template.git
synced 2026-02-23 06:37:01 +00:00
类型优化
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user