refactor: 优化非 CRUD 代码可读性
This commit is contained in:
@@ -184,7 +184,7 @@ function extractTopMenuPath(path: string): string {
|
||||
function handleTopMenuSelect(menuPath: string) {
|
||||
if (menuPath === activeTopMenuPath.value) return;
|
||||
|
||||
appStore.activeTopMenu(menuPath);
|
||||
appStore.setActiveTopMenuPath(menuPath);
|
||||
permissionStore.setMixLayoutSideMenus(menuPath);
|
||||
navigateToFirstMenu(permissionStore.mixLayoutSideMenus);
|
||||
}
|
||||
@@ -215,7 +215,7 @@ watch(
|
||||
const isTopMenuChanged = topMenuPath !== activeTopMenuPath.value;
|
||||
|
||||
if (isTopMenuChanged) {
|
||||
appStore.activeTopMenu(topMenuPath);
|
||||
appStore.setActiveTopMenuPath(topMenuPath);
|
||||
}
|
||||
|
||||
// 切换布局(如左侧 -> 混合)时,activeTopMenuPath 可能已是正确值,
|
||||
|
||||
@@ -31,9 +31,9 @@ export function useLayout() {
|
||||
appStore.toggleDevice(device);
|
||||
|
||||
if (isDesktop.value) {
|
||||
appStore.openSideBar();
|
||||
appStore.openSidebar();
|
||||
} else {
|
||||
appStore.closeSideBar();
|
||||
appStore.closeSidebar();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -82,7 +82,7 @@ export function useLayout() {
|
||||
}
|
||||
|
||||
function closeSidebar() {
|
||||
appStore.closeSideBar();
|
||||
appStore.closeSidebar();
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user