fix(projects):fixed the issue where switching the layout mode from mobile to vertical would not restore the user-defined layout mode.

This commit is contained in:
lan 2024-03-25 00:14:45 +08:00
parent c11d56da29
commit 9fd5d922ac
2 changed files with 6 additions and 2 deletions

View File

@ -82,10 +82,12 @@ export const useAppStore = defineStore(SetupStoreId.App, () => {
watch(
isMobile,
newValue => {
setSiderCollapse(newValue);
if (newValue) {
setSiderCollapse(true);
themeStore.layout.userMode = themeStore.layout.mode;
themeStore.setThemeLayout('vertical');
} else {
themeStore.setThemeLayout(themeStore.layout.userMode);
}
},
{ immediate: true }

View File

@ -28,6 +28,8 @@ declare namespace App {
layout: {
/** Layout mode */
mode: UnionKey.ThemeLayoutMode;
/** User Config mode */
userMode: UnionKey.ThemeLayoutMode;
/** Scroll mode */
scrollMode: UnionKey.ThemeScrollMode;
};