From 336be680d307acf8a1710194eba5505f8532d0bb Mon Sep 17 00:00:00 2001 From: HUCHAOQI Date: Mon, 17 May 2021 09:31:03 +0800 Subject: [PATCH] fix(store): addTab fx (#607) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在更新tabList的时候也能同时更新cacheTab --- src/store/modules/multipleTab.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/store/modules/multipleTab.ts b/src/store/modules/multipleTab.ts index 450dee41e..848b7b286 100644 --- a/src/store/modules/multipleTab.ts +++ b/src/store/modules/multipleTab.ts @@ -136,10 +136,10 @@ export const useMultipleTabStore = defineStore({ curTab.query = query || curTab.query; curTab.fullPath = fullPath || curTab.fullPath; this.tabList.splice(updateIndex, 1, curTab); - return; + } else { + // Add tab + this.tabList.push(route); } - // Add tab - this.tabList.push(route); this.updateCacheTab(); cacheTab && Persistent.setLocal(MULTIPLE_TABS_KEY, this.tabList); },