fix: fix keepAlive parameter error (#4194)

* fix: mock server deployment error

* chore: typo
This commit is contained in:
Vben
2024-08-19 23:28:14 +08:00
committed by GitHub
parent 01d60336a6
commit 1db87ff7ce
23 changed files with 115 additions and 101 deletions

View File

@@ -47,7 +47,7 @@ export const useTabbarStore = defineStore('core-tabbar', {
return !paths.includes(getTabPath(item));
});
this.updateCacheTab();
this.updateCacheTabs();
},
/**
* @zh_CN 关闭标签页
@@ -141,7 +141,7 @@ export const useTabbarStore = defineStore('core-tabbar', {
this.tabs.splice(tabIndex, 1, mergedTab);
}
this.updateCacheTab();
this.updateCacheTabs();
},
/**
* @zh_CN 关闭所有标签页
@@ -150,7 +150,7 @@ export const useTabbarStore = defineStore('core-tabbar', {
const newTabs = this.tabs.filter((tab) => isAffixTab(tab));
this.tabs = newTabs.length > 0 ? newTabs : [...this.tabs].splice(0, 1);
await this._goToDefaultTab(router);
this.updateCacheTab();
this.updateCacheTabs();
},
/**
* @zh_CN 关闭左侧标签页
@@ -230,7 +230,7 @@ export const useTabbarStore = defineStore('core-tabbar', {
// 关闭不是激活选项卡
if (getTabPath(currentRoute.value) !== getTabPath(tab)) {
this._close(tab);
this.updateCacheTab();
this.updateCacheTabs();
return;
}
const index = this.getTabs.findIndex(
@@ -339,7 +339,7 @@ export const useTabbarStore = defineStore('core-tabbar', {
);
if (findTab) {
findTab.meta.newTabTitle = undefined;
await this.updateCacheTab();
await this.updateCacheTabs();
}
},
@@ -367,7 +367,7 @@ export const useTabbarStore = defineStore('core-tabbar', {
if (findTab) {
findTab.meta.newTabTitle = title;
await this.updateCacheTab();
await this.updateCacheTabs();
}
},
@@ -417,7 +417,7 @@ export const useTabbarStore = defineStore('core-tabbar', {
/**
* 根据当前打开的选项卡更新缓存
*/
async updateCacheTab() {
async updateCacheTabs() {
const cacheMap = new Set<string>();
for (const tab of this.tabs) {
@@ -426,7 +426,7 @@ export const useTabbarStore = defineStore('core-tabbar', {
if (!keepAlive) {
continue;
}
tab.matched.forEach((t, i) => {
(tab.matched || []).forEach((t, i) => {
if (i > 0) {
cacheMap.add(t.name as string);
}