fix: 修复移动端左侧菜单无法显示的问题

This commit is contained in:
insistence
2024-06-30 21:55:37 +08:00
parent c64519d8f9
commit d0e82b56ab

View File

@@ -40,10 +40,13 @@ const classObj = computed(() => ({
const { width, height } = useWindowSize();
const WIDTH = 992; // refer to Bootstrap's responsive design
watchEffect(() => {
watch(() => device.value, () => {
if (device.value === 'mobile' && sidebar.value.opened) {
useAppStore().closeSideBar({ withoutAnimation: false })
}
})
watchEffect(() => {
if (width.value - 1 < WIDTH) {
useAppStore().toggleDevice('mobile')
useAppStore().closeSideBar({ withoutAnimation: true })