From a792bb5cb3c388ba3b93e17bab8f42d23cd5df4a Mon Sep 17 00:00:00 2001 From: Soybean Date: Tue, 28 Jun 2022 07:49:26 +0800 Subject: [PATCH] =?UTF-8?q?fix(projects):=20=E4=BF=AE=E5=A4=8Dtab=E4=B8=8D?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E8=B7=AF=E7=94=B1=E9=A6=96=E9=A1=B5=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/modules/tab/index.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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) {