Template
1
0
mirror of https://github.com/un-pany/v3-admin-vite.git synced 2025-04-22 03:49:19 +08:00

解决侧边子菜单不需要在侧边显示时出现的bug

当所有子菜单,都设定不再侧边显示后,侧边栏会有问题
This commit is contained in:
淳冉 2024-08-20 11:41:36 +08:00 committed by GitHub
parent 372a63439b
commit 9c353c416c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -54,7 +54,7 @@ const resolvePath = (routePath: string) => {
</script>
<template>
<template v-if="!alwaysShowRootMenu && theOnlyOneChild && !theOnlyOneChild.children">
<template v-if="!alwaysShowRootMenu && theOnlyOneChild && (!theOnlyOneChild.children || theOnlyOneChild.children.filter((item: any) => !item.meta?.hidden).length === 0)">
<SidebarItemLink v-if="theOnlyOneChild.meta" :to="resolvePath(theOnlyOneChild.path)">
<el-menu-item :index="resolvePath(theOnlyOneChild.path)">
<SvgIcon v-if="theOnlyOneChild.meta.svgIcon" :name="theOnlyOneChild.meta.svgIcon" />