Commit 336be680d307acf8a1710194eba5505f8532d0bb

Authored by HUCHAOQI
Committed by GitHub
1 parent adff788d

fix(store): addTab fx (#607)

在更新tabList的时候也能同时更新cacheTab
src/store/modules/multipleTab.ts
@@ -136,10 +136,10 @@ export const useMultipleTabStore = defineStore({ @@ -136,10 +136,10 @@ export const useMultipleTabStore = defineStore({
136 curTab.query = query || curTab.query; 136 curTab.query = query || curTab.query;
137 curTab.fullPath = fullPath || curTab.fullPath; 137 curTab.fullPath = fullPath || curTab.fullPath;
138 this.tabList.splice(updateIndex, 1, curTab); 138 this.tabList.splice(updateIndex, 1, curTab);
139 - return; 139 + } else {
  140 + // Add tab
  141 + this.tabList.push(route);
140 } 142 }
141 - // Add tab  
142 - this.tabList.push(route);  
143 this.updateCacheTab(); 143 this.updateCacheTab();
144 cacheTab && Persistent.setLocal(MULTIPLE_TABS_KEY, this.tabList); 144 cacheTab && Persistent.setLocal(MULTIPLE_TABS_KEY, this.tabList);
145 }, 145 },