diff --git a/src/store/modules/tab/index.ts b/src/store/modules/tab/index.ts index ce8056e1..87b78018 100644 --- a/src/store/modules/tab/index.ts +++ b/src/store/modules/tab/index.ts @@ -225,7 +225,11 @@ export const useTabStore = defineStore('tab-store', { if (!isHome) { const currentTab = getTabRouteByVueRoute(currentRoute); if (!currentRoute.meta.multiTab) { - tabs.splice(index, 1, currentTab); + if (index > -1) { + tabs.splice(index, 1, currentTab); + } else { + tabs.push(currentTab); + } } else { const hasCurrent = isInTabRoutes(tabs, currentRoute.fullPath); if (!hasCurrent) {