Skip to content

Commit

Permalink
fix: 3rd level menu path (#196)
Browse files Browse the repository at this point in the history
  • Loading branch information
uyarn authored Nov 29, 2022
1 parent edd4a31 commit 3a377ff
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/layouts/components/MenuContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<template v-for="item in list">
<template v-if="!item.children || !item.children.length || item.meta?.single">
<t-menu-item
:key="item.path"
v-if="getHref(item)"
:key="`href${item.path}`"
:href="getHref(item)?.[0]"
:name="item.path"
:value="item.meta?.single ? item.redirect : item.path"
Expand All @@ -16,11 +16,11 @@
{{ item.title }}
</t-menu-item>
<t-menu-item
:key="item.path"
v-else
:key="`${item.path}`"
:to="item.path"
:name="item.path"
:value="item.meta?.single ? item.redirect : item.path"
:to="item.path"
>
<template #icon>
<t-icon v-if="typeof item.icon === 'string' && item.icon" :name="item.icon" />
Expand Down Expand Up @@ -50,9 +50,10 @@ const getMenuList = (list: MenuRoute[], basePath?: string): MenuRoute[] => {
if (!list) {
return [];
}
return list
.map((item) => {
const path = basePath ? `${basePath}/${item.path}` : item.path;
const path = basePath && !item.path.includes(basePath) ? `${basePath}/${item.path}` : item.path;
return {
path,
title: item.meta?.title,
Expand Down

0 comments on commit 3a377ff

Please sign in to comment.