From 1400b6333378996bea695dc2885754a0632599e3 Mon Sep 17 00:00:00 2001 From: "gary.fu" Date: Mon, 24 Aug 2026 15:53:47 +0800 Subject: [PATCH] =?UTF-8?q?bug:=20=E4=BF=AE=E5=A4=8D=E5=B7=A6=E4=BE=A7?= =?UTF-8?q?=E8=8F=9C=E5=8D=95=E5=B1=95=E5=BC=80=E6=97=B6=E5=8A=A8=E7=94=BB?= =?UTF-8?q?=E4=B8=A2=E5=A4=B1=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/HomeView.vue | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue index 4743183..e575dfc 100644 --- a/src/views/HomeView.vue +++ b/src/views/HomeView.vue @@ -4,7 +4,7 @@ import MainContent from '@/layout/MainContent.vue' import GlobalSettings from '@/views/components/global/GlobalSettings.vue' import { useGlobalConfigStore } from '@/stores/GlobalConfigStore' import { GlobalLayoutMode } from '@/consts/GlobalConstants' -import { computed, ref } from 'vue' +import { computed, ref, watch, onUnmounted } from 'vue' import { useMenuConfigStore } from '@/stores/MenuConfigStore' import { useTabModeScrollSaver } from '@/route/RouteUtils' @@ -14,6 +14,31 @@ const showLeftMenu = computed(() => { }) const leftMenuAsideRef = ref(null) +// 控制 split 是否启用:收起时立即禁用 split;展开时先执行 CSS 展开动画,300ms 动画完成后再启用 split +const isSplitDisabled = ref(globalConfigStore.isCollapseLeft) +let expandTimer = null + +watch(() => globalConfigStore.isCollapseLeft, (collapsed) => { + if (expandTimer) { + clearTimeout(expandTimer) + expandTimer = null + } + if (collapsed) { + isSplitDisabled.value = true + } else { + isSplitDisabled.value = true + expandTimer = setTimeout(() => { + isSplitDisabled.value = false + }, 300) + } +}, { immediate: true }) + +onUnmounted(() => { + if (expandTimer) { + clearTimeout(expandTimer) + } +}) + const handleDragEnd = () => { if (leftMenuAsideRef.value) { const width = leftMenuAsideRef.value.$el.offsetWidth @@ -31,7 +56,7 @@ useMenuConfigStore().loadBusinessMenus()