fix: 修复从左侧模式切到混合模式首页不显示在左侧菜单问题
This commit is contained in:
@@ -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);
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user