diff --git a/src/composables/layout.ts b/src/composables/layout.ts index 3280da2bb..0db24db4e 100644 --- a/src/composables/layout.ts +++ b/src/composables/layout.ts @@ -1,4 +1,4 @@ -import { computed } from 'vue'; +import { computed, watch } from 'vue'; import { breakpointsTailwind, useBreakpoints } from '@vueuse/core'; import { useAppStore, useThemeStore } from '@/store'; @@ -63,6 +63,16 @@ export function useBasicLayout() { return w; }); + watch( + isMobile, + newValue => { + if (newValue) { + app.setSiderCollapse(true); + } + }, + { immediate: true } + ); + return { mode, isMobile,