This commit is contained in:
xiaoma
2021-09-29 10:20:48 +08:00
parent ef4912636e
commit 3bf1e941d4
2 changed files with 6 additions and 8 deletions

View File

@@ -88,13 +88,11 @@
); );
// 监听菜单收缩状态 // 监听菜单收缩状态
watch( // watch(
() => props.collapsed, // () => props.collapsed,
(newVal) => { // (newVal) => {
state.openKeys = newVal ? [] : getOpenKeys; // }
selectedKeys.value = currentRoute.name as string; // );
}
);
// 跟随页面路由变化,切换菜单选中状态 // 跟随页面路由变化,切换菜单选中状态
watch( watch(

View File

@@ -2,7 +2,7 @@
<n-layout class="layout" :position="fixedMenu" has-sider> <n-layout class="layout" :position="fixedMenu" has-sider>
<n-layout-sider <n-layout-sider
v-if="isMixMenuNoneSub && (navMode === 'vertical' || navMode === 'horizontal-mix')" v-if="isMixMenuNoneSub && (navMode === 'vertical' || navMode === 'horizontal-mix')"
show-trigger show-trigger="bar"
@collapse="collapsed = true" @collapse="collapsed = true"
:position="fixedMenu" :position="fixedMenu"
@expand="collapsed = false" @expand="collapsed = false"