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

pull/24/MERGE
xingyu 2023-06-17 18:57:32 +08:00
parent 887296c19a
commit 477a658645
2 changed files with 6 additions and 1 deletions

View File

@ -108,7 +108,7 @@ export function useMenuSetting() {
// Set menu configuration
function setMenuSetting(menuSetting: Partial<MenuSetting>): void {
appStore.setProjectConfig({ menuSetting })
appStore.setMenuSetting(menuSetting)
}
function toggleCollapsed() {

View File

@ -85,6 +85,11 @@ export const useAppStore = defineStore('app', {
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()
Persistent.clearAll()