From d0e82b56abb02e51561c0f15490c919c20b9bc09 Mon Sep 17 00:00:00 2001 From: insistence <3055204202@qq.com> Date: Sun, 30 Jun 2024 21:55:37 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=A7=BB=E5=8A=A8?= =?UTF-8?q?=E7=AB=AF=E5=B7=A6=E4=BE=A7=E8=8F=9C=E5=8D=95=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-fastapi-frontend/src/layout/index.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ruoyi-fastapi-frontend/src/layout/index.vue b/ruoyi-fastapi-frontend/src/layout/index.vue index 3ddb165..bad8dae 100644 --- a/ruoyi-fastapi-frontend/src/layout/index.vue +++ b/ruoyi-fastapi-frontend/src/layout/index.vue @@ -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 })