Commit a0fdceeae7e25049eef6dc7dc920876f02329c3c
1 parent
c6e5c0f5
fix: 修复边栏无法打开问题,deepMerge函数有问题未修复
Showing
2 changed files
with
5 additions
and
3 deletions
src/hooks/setting/useMenuSetting.ts
@@ -123,7 +123,7 @@ export function useMenuSetting() { | @@ -123,7 +123,7 @@ export function useMenuSetting() { | ||
123 | 123 | ||
124 | // Set menu configuration | 124 | // Set menu configuration |
125 | function setMenuSetting(menuSetting: Partial<MenuSetting>): void { | 125 | function setMenuSetting(menuSetting: Partial<MenuSetting>): void { |
126 | - appStore.setProjectConfig({ menuSetting }); | 126 | + appStore.setMenuSetting(menuSetting); |
127 | } | 127 | } |
128 | 128 | ||
129 | function toggleCollapsed() { | 129 | function toggleCollapsed() { |
@@ -133,9 +133,7 @@ export function useMenuSetting() { | @@ -133,9 +133,7 @@ export function useMenuSetting() { | ||
133 | } | 133 | } |
134 | return { | 134 | return { |
135 | setMenuSetting, | 135 | setMenuSetting, |
136 | - | ||
137 | toggleCollapsed, | 136 | toggleCollapsed, |
138 | - | ||
139 | getMenuFixed, | 137 | getMenuFixed, |
140 | getRealWidth, | 138 | getRealWidth, |
141 | getMenuType, | 139 | getMenuType, |
src/store/modules/app.ts
@@ -82,6 +82,10 @@ export const useAppStore = defineStore({ | @@ -82,6 +82,10 @@ export const useAppStore = defineStore({ | ||
82 | this.projectConfig = deepMerge(this.projectConfig || {}, config); | 82 | this.projectConfig = deepMerge(this.projectConfig || {}, config); |
83 | Persistent.setLocal(PROJ_CFG_KEY, this.projectConfig); | 83 | Persistent.setLocal(PROJ_CFG_KEY, this.projectConfig); |
84 | }, | 84 | }, |
85 | + setMenuSetting(setting: Partial<MenuSetting>): void { | ||
86 | + this.projectConfig.menuSetting = deepMerge(this.projectConfig.menuSetting, setting); | ||
87 | + Persistent.setLocal(PROJ_CFG_KEY, this.projectConfig); | ||
88 | + }, | ||
85 | 89 | ||
86 | async resetAllState() { | 90 | async resetAllState() { |
87 | resetRouter(); | 91 | resetRouter(); |