mirror of
https://gitee.com/fantastic-admin/basic.git
synced 2024-11-29 18:48:31 +08:00
fix: 修复带参路由无法记录到标签栏中
This commit is contained in:
parent
cb230f77bd
commit
1e155369b2
@ -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
src/types/global.d.ts
vendored
1
src/types/global.d.ts
vendored
@ -294,7 +294,6 @@ declare namespace Tabbar {
|
||||
interface recordRaw {
|
||||
tabId: string
|
||||
fullPath: string
|
||||
routeName?: RouteRecordName | null
|
||||
title?: string | (() => string)
|
||||
icon?: string
|
||||
name: string[]
|
||||
|
Loading…
Reference in New Issue
Block a user