From 0780d9659b229f80a3c9788988ec7d9ccd63ddbb Mon Sep 17 00:00:00 2001
From: RuoYi <yzz_ivy@163.com>
Date: 星期六, 29 六月 2024 21:44:21 +0800
Subject: [PATCH] 修复移动端左侧菜单无法显示问题

---
 src/layout/index.vue |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/src/layout/index.vue b/src/layout/index.vue
index 52d821b..04c7ef2 100644
--- a/src/layout/index.vue
+++ b/src/layout/index.vue
@@ -40,10 +40,13 @@
 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 })

--
Gitblit v1.9.3