修复移动端模式,菜单无法显示问题

Signed-off-by: Po <448443959@qq.com>
This commit is contained in:
Po
2024-11-15 13:07:21 +00:00
committed by Gitee
parent 6b47ae232d
commit 6b491d1246

View File

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