Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: tab close by key, fixed: #4132 #4136

Merged
merged 1 commit into from
Aug 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion packages/stores/src/modules/tabbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export const useTabbarStore = defineStore('core-tabbar', {
/**
* @zh_CN 跳转到标签页
* @param tab
* @param router
*/
async _goToTab(tab: TabDefinition, router: Router) {
const { params, path, query } = tab;
Expand Down Expand Up @@ -243,9 +244,13 @@ export const useTabbarStore = defineStore('core-tabbar', {
/**
* @zh_CN 通过key关闭标签页
* @param key
* @param router
*/
async closeTabByKey(key: string, router: Router) {
const index = this.tabs.findIndex((item) => getTabPath(item) === key);
const originKey = decodeURIComponent(key);
const index = this.tabs.findIndex(
(item) => getTabPath(item) === originKey,
);
if (index === -1) {
return;
}
Expand Down
Loading