fix tagsview

This commit is contained in:
baixi233
2022-06-21 11:30:59 +08:00
parent f616852053
commit b2c22996ce

View File

@@ -46,16 +46,16 @@ export const useTabsViewStore = defineStore({
closeLeftTabs(route) {
// 关闭左侧
const index = this.tabsList.findIndex((item) => item.fullPath == route.fullPath);
this.tabsList.splice(0, index);
this.tabsList = this.tabsList.filter((item, i) => i >= index || (item?.meta?.affix ?? false));
},
closeRightTabs(route) {
// 关闭右侧
const index = this.tabsList.findIndex((item) => item.fullPath == route.fullPath);
this.tabsList.splice(index + 1);
this.tabsList = this.tabsList.filter((item, i) => i <= index || (item?.meta?.affix ?? false));
},
closeOtherTabs(route) {
// 关闭其他
this.tabsList = this.tabsList.filter((item) => item.fullPath == route.fullPath);
this.tabsList = this.tabsList.filter((item) => item.fullPath == route.fullPath || (item?.meta?.affix ?? false));
},
closeCurrentTab(route) {
// 关闭当前页