Skip to content

Commit

Permalink
fix: 修复带参路由无法记录到标签栏中
Browse files Browse the repository at this point in the history
  • Loading branch information
hooray committed Aug 8, 2024
1 parent cb230f7 commit 1e15536
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
8 changes: 1 addition & 7 deletions src/store/modules/tabbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,13 @@ const useTabbarStore = defineStore(
if (route.name !== 'reload') {
// 记录查找到的标签页
const findTab = list.value.find((item) => {
if (item.routeName) {
return item.routeName === route.name
}
else {
return item.tabId === tabId
}
return item.tabId === tabId
})
// 新增标签页
if (!findTab) {
const listItem = {
tabId,
fullPath: route.fullPath,
routeName: route.name,
title: typeof meta?.title === 'function' ? meta.title() : meta?.title,
icon: meta?.icon ?? meta?.breadcrumbNeste?.findLast(item => item.icon)?.icon,
name: names,
Expand Down
1 change: 0 additions & 1 deletion src/types/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,6 @@ declare namespace Tabbar {
interface recordRaw {
tabId: string
fullPath: string
routeName?: RouteRecordName | null
title?: string | (() => string)
icon?: string
name: string[]
Expand Down

0 comments on commit 1e15536

Please sign in to comment.