fix(store): addTab fx (#607)

在更新tabList的时候也能同时更新cacheTab
This commit is contained in:
HUCHAOQI
2021-05-17 09:31:03 +08:00
committed by GitHub
parent adff788de5
commit 336be680d3

View File

@@ -136,10 +136,10 @@ export const useMultipleTabStore = defineStore({
curTab.query = query || curTab.query; curTab.query = query || curTab.query;
curTab.fullPath = fullPath || curTab.fullPath; curTab.fullPath = fullPath || curTab.fullPath;
this.tabList.splice(updateIndex, 1, curTab); this.tabList.splice(updateIndex, 1, curTab);
return; } else {
// Add tab
this.tabList.push(route);
} }
// Add tab
this.tabList.push(route);
this.updateCacheTab(); this.updateCacheTab();
cacheTab && Persistent.setLocal(MULTIPLE_TABS_KEY, this.tabList); cacheTab && Persistent.setLocal(MULTIPLE_TABS_KEY, this.tabList);
}, },