mirror of
https://github.com/chansee97/nova-admin.git
synced 2025-04-06 03:57:54 +08:00
fix: Ensure parent node expands in Tab routing switch
This commit is contained in:
parent
ad21f7f4fa
commit
0eb4dcbeb3
@ -1,13 +1,25 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import type { MenuInst } from 'naive-ui'
|
||||||
import { useAppStore } from '@/store'
|
import { useAppStore } from '@/store'
|
||||||
import { useRouteStore } from '@/store/route'
|
import { useRouteStore } from '@/store/route'
|
||||||
|
|
||||||
|
const route = useRoute()
|
||||||
const appStore = useAppStore()
|
const appStore = useAppStore()
|
||||||
const routesStore = useRouteStore()
|
const routesStore = useRouteStore()
|
||||||
|
const menuInstRef = ref<MenuInst | null>(null)
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => route.path,
|
||||||
|
() => {
|
||||||
|
menuInstRef.value?.showOption(routesStore.activeMenu as string)
|
||||||
|
},
|
||||||
|
{ immediate: true },
|
||||||
|
)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<n-menu
|
<n-menu
|
||||||
|
ref="menuInstRef"
|
||||||
:collapsed="appStore.collapsed"
|
:collapsed="appStore.collapsed"
|
||||||
:indent="20"
|
:indent="20"
|
||||||
:collapsed-width="64"
|
:collapsed-width="64"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user