fix(projects): hide the drawer when it is initial mobile mode [初始化时为移动端布局则隐藏侧边栏] fixed #238

This commit is contained in:
Soybean 2023-05-26 13:08:35 +08:00
parent f2b518ed26
commit 0abde46ef4

View File

@ -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,