fix: 修复从左侧模式切到混合模式首页不显示在左侧菜单问题

This commit is contained in:
Ray.Hao
2026-01-18 09:00:03 +08:00
parent aeae199d7b
commit d172206d71

View File

@@ -207,8 +207,15 @@ watch(
() => route.path,
(newPath) => {
const topMenuPath = extractTopMenuPath(newPath);
if (topMenuPath !== activeTopMenuPath.value) {
const isTopMenuChanged = topMenuPath !== activeTopMenuPath.value;
if (isTopMenuChanged) {
appStore.activeTopMenu(topMenuPath);
}
// 切换布局(如左侧 -> 混合activeTopMenuPath 可能已是正确值,
// 但 mixLayoutSideMenus 仍为空,需要补一次初始化。
if (isTopMenuChanged || permissionStore.mixLayoutSideMenus.length === 0) {
permissionStore.setMixLayoutSideMenus(topMenuPath);
}
},