Skip to content

Commit 5726479

Browse files
committed
优化 tabId ,排除路由中的 query 参数
1 parent 3946ada commit 5726479

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/store/modules/tabbar.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export const useTabbarStore = defineStore(
1919
}
2020
})
2121
const meta = route.matched.at(-1)?.meta
22-
const tabId = route.fullPath
22+
const tabId = route.path
2323
if (route.name !== 'reload') {
2424
// 记录查找到的标签页
2525
const findTab = list.value.find((item) => {

src/utils/composables/useTabbar.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default function useTabbar() {
77
const tabbarStore = useTabbarStore()
88

99
function getId() {
10-
return route.fullPath
10+
return route.path
1111
}
1212

1313
function closeById(tabId = getId()) {

0 commit comments

Comments
 (0)