From 93c7ff712215a0acc3ce441e1fcedf3929d473b5 Mon Sep 17 00:00:00 2001 From: Soybean Date: Thu, 25 Apr 2024 22:07:23 +0800 Subject: [PATCH] fix(projects): fix mix-menu blank. fixed #389 & cache mixMenuFixed --- src/layouts/base-layout/index.vue | 7 +++---- .../modules/global-menu/vertical-mix-menu.vue | 6 ++++-- src/store/modules/app/index.ts | 13 +++++++++++-- src/typings/storage.d.ts | 2 ++ 4 files changed, 20 insertions(+), 8 deletions(-) diff --git a/src/layouts/base-layout/index.vue b/src/layouts/base-layout/index.vue index 845c42b6..948638b0 100644 --- a/src/layouts/base-layout/index.vue +++ b/src/layouts/base-layout/index.vue @@ -18,6 +18,7 @@ defineOptions({ const appStore = useAppStore(); const themeStore = useThemeStore(); +const { menus } = setupMixMenuContext(); const layoutMode = computed(() => { const vertical: LayoutMode = 'vertical'; @@ -65,7 +66,7 @@ function getSiderWidth() { let w = isVerticalMix.value || isHorizontalMix.value ? mixWidth : width; - if (isVerticalMix.value && appStore.mixSiderFixed) { + if (isVerticalMix.value && appStore.mixSiderFixed && menus.value.length) { w += mixChildMenuWidth; } @@ -77,14 +78,12 @@ function getSiderCollapsedWidth() { let w = isVerticalMix.value || isHorizontalMix.value ? mixCollapsedWidth : collapsedWidth; - if (isVerticalMix.value && appStore.mixSiderFixed) { + if (isVerticalMix.value && appStore.mixSiderFixed && menus.value.length) { w += mixChildMenuWidth; } return w; } - -setupMixMenuContext();