File tree 1 file changed +5
-4
lines changed
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 3
3
<template v-for =" item in list " >
4
4
<template v-if =" ! item .children || ! item .children .length || item .meta ?.single " >
5
5
<t-menu-item
6
- :key =" item.path"
7
6
v-if =" getHref(item)"
7
+ :key =" `href${item.path}`"
8
8
:href =" getHref(item)?.[0]"
9
9
:name =" item.path"
10
10
:value =" item.meta?.single ? item.redirect : item.path"
16
16
{{ item.title }}
17
17
</t-menu-item >
18
18
<t-menu-item
19
- :key =" item.path"
20
19
v-else
20
+ :key =" `${item.path}`"
21
+ :to =" item.path"
21
22
:name =" item.path"
22
23
:value =" item.meta?.single ? item.redirect : item.path"
23
- :to =" item.path"
24
24
>
25
25
<template #icon >
26
26
<t-icon v-if =" typeof item.icon === 'string' && item.icon" :name =" item.icon" />
@@ -50,9 +50,10 @@ const getMenuList = (list: MenuRoute[], basePath?: string): MenuRoute[] => {
50
50
if (! list ) {
51
51
return [];
52
52
}
53
+
53
54
return list
54
55
.map ((item ) => {
55
- const path = basePath ? ` ${basePath }/${item .path } ` : item .path ;
56
+ const path = basePath && ! item . path . includes ( basePath ) ? ` ${basePath }/${item .path } ` : item .path ;
56
57
return {
57
58
path ,
58
59
title: item .meta ?.title ,
You can’t perform that action at this time.
0 commit comments