Skip to content

Commit

Permalink
fix(store): 🧩 fix keepalive logic error when closing single tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
HalseySpicy committed Sep 19, 2023
1 parent dbfea63 commit 9011dab
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/stores/modules/tabs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@ export const useTabsStore = defineStore({
router.push(nextTab.path);
});
}
this.tabsMenuList = this.tabsMenuList.filter(item => item.path !== tabPath);
// remove keepalive
const tabItem = this.tabsMenuList.find(item => item.path === tabPath);
tabItem?.isKeepAlive && keepAliveStore.removeKeepAliveName(tabItem.name);
// set tabs
this.tabsMenuList = this.tabsMenuList.filter(item => item.path !== tabPath);
},
// Close Tabs On Side
async closeTabsOnSide(path: string, type: "left" | "right") {
Expand Down

0 comments on commit 9011dab

Please sign in to comment.