Commit cdeadafd by Netfan Committed by GitHub

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

1 parent ec49a041
...@@ -30,7 +30,7 @@ async function handleSelect(key: string) { ...@@ -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"
......
...@@ -81,7 +81,7 @@ function useExtraMenu() { ...@@ -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;
// } // }
......
...@@ -113,7 +113,7 @@ function useMixedMenu() { ...@@ -113,7 +113,7 @@ function useMixedMenu() {
// 初始化计算侧边菜单 // 初始化计算侧边菜单
onBeforeMount(() => { onBeforeMount(() => {
calcSideMenus(); calcSideMenus(route.meta?.activePath || route.path);
}); });
return { return {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!