Skip to content

Commit cb53f4c

Browse files
committed
fix: 修复一级路由设置 meta.menu: false 无效
1 parent 3164e33 commit cb53f4c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/layouts/components/Menu/index.vue

+4-2
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,10 @@ provide(rootMenuInjectionKey, reactive({
170170
}"
171171
>
172172
<template v-for="item in menu" :key="item.path ?? JSON.stringify(item)">
173-
<SubMenu v-if="item.children?.length" :menu="item" :unique-key="[item.path ?? JSON.stringify(item)]" />
174-
<Item v-else :item="item" :unique-key="[item.path ?? JSON.stringify(item)]" @click="handleMenuItemClick(item.path ?? JSON.stringify(item))" />
173+
<template v-if="item.meta?.menu !== false">
174+
<SubMenu v-if="item.children?.length" :menu="item" :unique-key="[item.path ?? JSON.stringify(item)]" />
175+
<Item v-else :item="item" :unique-key="[item.path ?? JSON.stringify(item)]" @click="handleMenuItemClick(item.path ?? JSON.stringify(item))" />
176+
</template>
175177
</template>
176178
</div>
177179
</template>

0 commit comments

Comments
 (0)