This commit is contained in:
dap
2024-08-20 08:44:26 +08:00
99 changed files with 1312 additions and 785 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "@vben/stores",
"version": "5.1.0",
"version": "5.1.1",
"homepage": "https://github.com/vbenjs/vue-vben-admin",
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
"repository": {

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);
}