Skip to content

Commit 3a377ff

Browse files
authored
fix: 3rd level menu path (#196)
1 parent edd4a31 commit 3a377ff

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/layouts/components/MenuContent.vue

+5-4
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
<template v-for="item in list">
44
<template v-if="!item.children || !item.children.length || item.meta?.single">
55
<t-menu-item
6-
:key="item.path"
76
v-if="getHref(item)"
7+
:key="`href${item.path}`"
88
:href="getHref(item)?.[0]"
99
:name="item.path"
1010
:value="item.meta?.single ? item.redirect : item.path"
@@ -16,11 +16,11 @@
1616
{{ item.title }}
1717
</t-menu-item>
1818
<t-menu-item
19-
:key="item.path"
2019
v-else
20+
:key="`${item.path}`"
21+
:to="item.path"
2122
:name="item.path"
2223
:value="item.meta?.single ? item.redirect : item.path"
23-
:to="item.path"
2424
>
2525
<template #icon>
2626
<t-icon v-if="typeof item.icon === 'string' && item.icon" :name="item.icon" />
@@ -50,9 +50,10 @@ const getMenuList = (list: MenuRoute[], basePath?: string): MenuRoute[] => {
5050
if (!list) {
5151
return [];
5252
}
53+
5354
return list
5455
.map((item) => {
55-
const path = basePath ? `${basePath}/${item.path}` : item.path;
56+
const path = basePath && !item.path.includes(basePath) ? `${basePath}/${item.path}` : item.path;
5657
return {
5758
path,
5859
title: item.meta?.title,

0 commit comments

Comments
 (0)