mirror of
https://github.com/un-pany/v3-admin-vite.git
synced 2025-04-20 19:09:21 +08:00
fix: 修复处于顶部模式时 el-menu 未自适应宽度去折叠的问题 (#153)
Co-authored-by: pany <939630029@qq.com>
This commit is contained in:
parent
56f294d51c
commit
9510639b49
@ -60,10 +60,7 @@ const resolvePath = (routePath: string) => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div
|
||||
v-if="!props.item.meta?.hidden"
|
||||
:class="{ 'simple-mode': props.isCollapse && !isTop, 'first-level': props.isFirstLevel }"
|
||||
>
|
||||
<div :class="{ 'simple-mode': props.isCollapse && !isTop, 'first-level': props.isFirstLevel }">
|
||||
<template v-if="!alwaysShowRootMenu && theOnlyOneChild && !theOnlyOneChild.children">
|
||||
<SidebarItemLink v-if="theOnlyOneChild.meta" :to="resolvePath(theOnlyOneChild.path)">
|
||||
<el-menu-item :index="resolvePath(theOnlyOneChild.path)">
|
||||
|
@ -29,7 +29,7 @@ const activeMenu = computed(() => {
|
||||
} = route
|
||||
return activeMenu ? activeMenu : path
|
||||
})
|
||||
|
||||
const noHiddenRoutes = computed(() => permissionStore.routes.filter((item) => !item.meta?.hidden))
|
||||
const isCollapse = computed(() => !sidebar.value.opened)
|
||||
const isLeft = computed(() => layoutMode.value === "left")
|
||||
const isTop = computed(() => layoutMode.value === "top")
|
||||
@ -68,7 +68,7 @@ const hiddenScrollbarVerticalBar = computed(() => {
|
||||
:mode="isTop && !isMobile ? 'horizontal' : 'vertical'"
|
||||
>
|
||||
<SidebarItem
|
||||
v-for="route in permissionStore.routes"
|
||||
v-for="route in noHiddenRoutes"
|
||||
:key="route.path"
|
||||
:item="route"
|
||||
:base-path="route.path"
|
||||
|
Loading…
x
Reference in New Issue
Block a user