fix: 修复带参路由无法记录到标签栏中

This commit is contained in:
Hooray Hu 2024-08-08 16:12:22 +08:00
parent cb230f77bd
commit 1e155369b2
2 changed files with 1 additions and 8 deletions

View File

@ -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,

View File

@ -294,7 +294,6 @@ declare namespace Tabbar {
interface recordRaw {
tabId: string
fullPath: string
routeName?: RouteRecordName | null
title?: string | (() => string)
icon?: string
name: string[]