修复文件系统路由下,导航栏无法展开多级和一级导航无法点击

This commit is contained in:
Hooray Hu 2023-11-15 00:13:38 +08:00
parent 41aca36bd7
commit bb135be01a
2 changed files with 3 additions and 3 deletions

View File

@ -175,7 +175,7 @@ provide(rootMenuInjectionKey, reactive({
>
<template v-for="(item, index) in menu" :key="index">
<SubMenu v-if="item.children?.length" :menu="item" :unique-key="[item.path ?? JSON.stringify(item)]" />
<Item v-else :item="item" :unique-key="[item.path ?? JSON.stringify(item)]" />
<Item v-else :item="item" :unique-key="[item.path ?? JSON.stringify(item)]" @click="handleMenuItemClick(item.path ?? JSON.stringify(item), item.meta)" />
</template>
</div>
</template>

View File

@ -188,8 +188,8 @@ function handleMouseleave() {
'mx-2': rootMenu.isMenuPopup && (rootMenu.props.mode === 'vertical' || level !== 0),
}"
>
<template v-for="item in menu.children" :key="item.path">
<SubMenu v-if="item.meta?.sidebar !== false" :unique-key="[...uniqueKey, item.path]" :menu="item" :level="level + 1" />
<template v-for="item in menu.children" :key="item.path ?? JSON.stringify(item)">
<SubMenu v-if="item.meta?.sidebar !== false" :unique-key="[...uniqueKey, item.path ?? JSON.stringify(item)]" :menu="item" :level="level + 1" />
</template>
</OverlayScrollbarsComponent>
</Transition>