fix: activePath not working in menu, fixed: #4112 (#4113)

pull/48/MERGE
Netfan 2024-08-10 18:54:57 +08:00 committed by GitHub
parent ec49a04151
commit cdeadafda5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 3 deletions

View File

@ -30,7 +30,7 @@ async function handleSelect(key: string) {
<Menu <Menu
:accordion="accordion" :accordion="accordion"
:collapse="collapse" :collapse="collapse"
:default-active="route.path" :default-active="route.meta?.activePath || route.path"
:menus="menus" :menus="menus"
:rounded="rounded" :rounded="rounded"
:theme="theme" :theme="theme"

View File

@ -81,7 +81,7 @@ function useExtraMenu() {
watch( watch(
() => route.path, () => route.path,
(path) => { (path) => {
const currentPath = path; const currentPath = route.meta?.activePath || path;
// if (preferences.sidebar.expandOnHover) { // if (preferences.sidebar.expandOnHover) {
// return; // return;
// } // }

View File

@ -113,7 +113,7 @@ function useMixedMenu() {
// 初始化计算侧边菜单 // 初始化计算侧边菜单
onBeforeMount(() => { onBeforeMount(() => {
calcSideMenus(); calcSideMenus(route.meta?.activePath || route.path);
}); });
return { return {