Skip to content

Commit

Permalink
fix(projects): hide the drawer when it is initial mobile mode [初始化时为移…
Browse files Browse the repository at this point in the history
…动端布局则隐藏侧边栏] fixed #238
  • Loading branch information
honghuangdc committed May 26, 2023
1 parent f2b518e commit 0abde46
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/composables/layout.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { computed } from 'vue';
import { computed, watch } from 'vue';
import { breakpointsTailwind, useBreakpoints } from '@vueuse/core';
import { useAppStore, useThemeStore } from '@/store';

Expand Down Expand Up @@ -63,6 +63,16 @@ export function useBasicLayout() {
return w;
});

watch(
isMobile,
newValue => {
if (newValue) {
app.setSiderCollapse(true);
}
},
{ immediate: true }
);

return {
mode,
isMobile,
Expand Down

1 comment on commit 0abde46

@vercel
Copy link

@vercel vercel bot commented on 0abde46 May 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.