fix(projects): hide the drawer when it is initial mobile mode [初始化时为移动端布局则隐藏侧边栏] fixed #238
This commit is contained in:
parent
f2b518ed26
commit
0abde46ef4
@ -1,4 +1,4 @@
|
|||||||
import { computed } from 'vue';
|
import { computed, watch } from 'vue';
|
||||||
import { breakpointsTailwind, useBreakpoints } from '@vueuse/core';
|
import { breakpointsTailwind, useBreakpoints } from '@vueuse/core';
|
||||||
import { useAppStore, useThemeStore } from '@/store';
|
import { useAppStore, useThemeStore } from '@/store';
|
||||||
|
|
||||||
@ -63,6 +63,16 @@ export function useBasicLayout() {
|
|||||||
return w;
|
return w;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
watch(
|
||||||
|
isMobile,
|
||||||
|
newValue => {
|
||||||
|
if (newValue) {
|
||||||
|
app.setSiderCollapse(true);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ immediate: true }
|
||||||
|
);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
mode,
|
mode,
|
||||||
isMobile,
|
isMobile,
|
||||||
|
Loading…
Reference in New Issue
Block a user