fix: 修复边栏无法打开问题,deepMerge函数有问题未修复

This commit is contained in:
jinmao88 2023-06-17 09:44:06 +08:00
parent c6e5c0f5f1
commit a0fdceeae7
2 changed files with 5 additions and 3 deletions

View File

@ -123,7 +123,7 @@ export function useMenuSetting() {
// Set menu configuration
function setMenuSetting(menuSetting: Partial<MenuSetting>): void {
appStore.setProjectConfig({ menuSetting });
appStore.setMenuSetting(menuSetting);
}
function toggleCollapsed() {
@ -133,9 +133,7 @@ export function useMenuSetting() {
}
return {
setMenuSetting,
toggleCollapsed,
getMenuFixed,
getRealWidth,
getMenuType,

View File

@ -82,6 +82,10 @@ export const useAppStore = defineStore({
this.projectConfig = deepMerge(this.projectConfig || {}, config);
Persistent.setLocal(PROJ_CFG_KEY, this.projectConfig);
},
setMenuSetting(setting: Partial<MenuSetting>): void {
this.projectConfig.menuSetting = deepMerge(this.projectConfig.menuSetting, setting);
Persistent.setLocal(PROJ_CFG_KEY, this.projectConfig);
},
async resetAllState() {
resetRouter();