From cdeadafda5c9104190f6f0f8d8d59e93046e9d17 Mon Sep 17 00:00:00 2001 From: Netfan Date: Sat, 10 Aug 2024 18:54:57 +0800 Subject: [PATCH] fix: activePath not working in menu, fixed: #4112 (#4113) --- packages/effects/layouts/src/basic/menu/extra-menu.vue | 2 +- packages/effects/layouts/src/basic/menu/use-extra-menu.ts | 2 +- packages/effects/layouts/src/basic/menu/use-mixed-menu.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/effects/layouts/src/basic/menu/extra-menu.vue b/packages/effects/layouts/src/basic/menu/extra-menu.vue index 39d2898d..d8ccc1b4 100644 --- a/packages/effects/layouts/src/basic/menu/extra-menu.vue +++ b/packages/effects/layouts/src/basic/menu/extra-menu.vue @@ -30,7 +30,7 @@ async function handleSelect(key: string) { route.path, (path) => { - const currentPath = path; + const currentPath = route.meta?.activePath || path; // if (preferences.sidebar.expandOnHover) { // return; // } diff --git a/packages/effects/layouts/src/basic/menu/use-mixed-menu.ts b/packages/effects/layouts/src/basic/menu/use-mixed-menu.ts index aedbd868..ca78fc0d 100644 --- a/packages/effects/layouts/src/basic/menu/use-mixed-menu.ts +++ b/packages/effects/layouts/src/basic/menu/use-mixed-menu.ts @@ -113,7 +113,7 @@ function useMixedMenu() { // 初始化计算侧边菜单 onBeforeMount(() => { - calcSideMenus(); + calcSideMenus(route.meta?.activePath || route.path); }); return {