mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-08-26 16:46:19 +08:00
fix: fix keepAlive parameter error (#4194)
* fix: mock server deployment error * chore: typo
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user