From c6b9a56b731580281c0f6e27e8debdcc53afcbc3 Mon Sep 17 00:00:00 2001 From: Li Kui <90845831+likui628@users.noreply.github.com> Date: Wed, 28 Aug 2024 09:58:59 +0800 Subject: [PATCH] fix: clearPreferencesAndLogout does not take effect when the preferences button is at the top (#4253) --- packages/@core/ui-kit/layout-ui/src/vben-layout.vue | 3 --- packages/effects/layouts/src/basic/header/header.vue | 11 ++++++++++- packages/effects/layouts/src/basic/layout.vue | 5 ++++- .../src/widgets/preferences/preferences-button.vue | 8 +++++++- .../src/widgets/preferences/preferences-drawer.vue | 1 - 5 files changed, 21 insertions(+), 7 deletions(-) diff --git a/packages/@core/ui-kit/layout-ui/src/vben-layout.vue b/packages/@core/ui-kit/layout-ui/src/vben-layout.vue index 2e2c981c..7fd4dd77 100644 --- a/packages/@core/ui-kit/layout-ui/src/vben-layout.vue +++ b/packages/@core/ui-kit/layout-ui/src/vben-layout.vue @@ -184,9 +184,6 @@ const headerFixed = computed(() => { }); const showSidebar = computed(() => { - // if (isMixedNav.value && !props.sideHidden) { - // return false; - // } return isSideMode.value && sidebarEnable.value; }); diff --git a/packages/effects/layouts/src/basic/header/header.vue b/packages/effects/layouts/src/basic/header/header.vue index 3febc93a..d2016ed1 100644 --- a/packages/effects/layouts/src/basic/header/header.vue +++ b/packages/effects/layouts/src/basic/header/header.vue @@ -27,6 +27,8 @@ withDefaults(defineProps(), { theme: 'light', }); +const emit = defineEmits<{ clearPreferencesAndLogout: [] }>(); + const accessStore = useAccessStore(); const { globalSearchShortcutKey, preferencesButtonPosition } = usePreferences(); const slots = useSlots(); @@ -90,6 +92,10 @@ const leftSlots = computed(() => { }); return list.sort((a, b) => a.index - b.index); }); + +function clearPreferencesAndLogout() { + emit('clearPreferencesAndLogout'); +}