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

This commit is contained in:
Hooray Hu
2024-08-08 16:12:08 +08:00
parent b581cf61d2
commit cea5c718be
2 changed files with 1 additions and 8 deletions
+1 -7
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,
-1
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[]