@@ -63,7 +63,7 @@ export const useTabbarStore = defineStore('core-tabbar', {
63
63
( item ) => ! keySet . has ( getTabKeyFromTab ( item ) ) ,
64
64
) ;
65
65
66
- this . updateCacheTabs ( ) ;
66
+ await this . updateCacheTabs ( ) ;
67
67
} ,
68
68
/**
69
69
* @zh_CN 关闭标签页
@@ -107,7 +107,7 @@ export const useTabbarStore = defineStore('core-tabbar', {
107
107
* @param routeTab
108
108
*/
109
109
addTab ( routeTab : TabDefinition ) : TabDefinition {
110
- const tab = cloneTab ( routeTab ) ;
110
+ let tab = cloneTab ( routeTab ) ;
111
111
if ( ! tab . key ) {
112
112
tab . key = getTabKey ( routeTab ) ;
113
113
}
@@ -162,7 +162,7 @@ export const useTabbarStore = defineStore('core-tabbar', {
162
162
mergedTab . meta . newTabTitle = curMeta . newTabTitle ;
163
163
}
164
164
}
165
-
165
+ tab = mergedTab ;
166
166
this . tabs . splice ( tabIndex , 1 , mergedTab ) ;
167
167
}
168
168
this . updateCacheTabs ( ) ;
@@ -609,16 +609,22 @@ function getTabKey(tab: RouteLocationNormalized | RouteRecordNormalized) {
609
609
fullPath,
610
610
path,
611
611
meta : { fullPathKey } = { } ,
612
- query : { pageKey } = { } ,
612
+ query = { } ,
613
613
} = tab as RouteLocationNormalized ;
614
+ // pageKey可能是数组(查询参数重复时可能出现)
615
+ const pageKey = Array . isArray ( query . pageKey )
616
+ ? query . pageKey [ 0 ]
617
+ : query . pageKey ;
618
+ let rawKey ;
614
619
if ( pageKey ) {
615
- return pageKey as string ;
620
+ rawKey = pageKey ;
621
+ } else {
622
+ rawKey = fullPathKey === false ? path : ( fullPath ?? path ) ;
616
623
}
617
- const rawKey = fullPathKey === false ? path : fullPath ;
618
624
try {
619
- return decodeURIComponent ( rawKey || path ) ;
625
+ return decodeURIComponent ( rawKey ) ;
620
626
} catch {
621
- return rawKey || path ;
627
+ return rawKey ;
622
628
}
623
629
}
624
630
0 commit comments