From 62a43c39575d978cb86be93fcbff38493a3ffedc Mon Sep 17 00:00:00 2001 From: Azir-11 <2075125282@qq.com> Date: Thu, 4 Dec 2025 16:03:02 +0800 Subject: [PATCH] fix(projects): fix the incorrect judgment of home by pin tab. --- src/layouts/modules/global-tab/context-menu.vue | 4 ++-- src/store/modules/tab/index.ts | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/layouts/modules/global-tab/context-menu.vue b/src/layouts/modules/global-tab/context-menu.vue index 3997bae6..1145ee2a 100644 --- a/src/layouts/modules/global-tab/context-menu.vue +++ b/src/layouts/modules/global-tab/context-menu.vue @@ -26,7 +26,7 @@ const props = withDefaults(defineProps(), { const visible = defineModel('visible'); -const { removeTab, clearTabs, clearLeftTabs, clearRightTabs, fixTab, unfixTab, isTabRetain } = useTabStore(); +const { removeTab, clearTabs, clearLeftTabs, clearRightTabs, fixTab, unfixTab, isTabRetain, homeTab } = useTabStore(); const { SvgIconVNode } = useSvgIcon(); type DropdownOption = { @@ -65,7 +65,7 @@ const options = computed(() => { } ]; - if (props.tabId !== '/home') { + if (props.tabId !== homeTab?.id) { if (isTabRetain(props.tabId)) { opts.push({ key: 'unpin', diff --git a/src/store/modules/tab/index.ts b/src/store/modules/tab/index.ts index ee47f454..4a7bcd7b 100644 --- a/src/store/modules/tab/index.ts +++ b/src/store/modules/tab/index.ts @@ -361,6 +361,7 @@ export const useTabStore = defineStore(SetupStoreId.Tab, () => { /** All tabs */ tabs: allTabs, activeTabId, + homeTab, initHomeTab, initTabStore, addTab,