|
@@ -4,7 +4,8 @@
|
|
:index="menuInfo.index"
|
|
:index="menuInfo.index"
|
|
popper-class="main-layout-submenu-popper"
|
|
popper-class="main-layout-submenu-popper"
|
|
class="main-layout-sub-menu"
|
|
class="main-layout-sub-menu"
|
|
- :class="{ 'is-collapse': mainLayoutStore.collapse, 'is-active': currentIndex === menuInfo.index }"
|
|
|
|
|
|
+ :class="{ 'is-collapse': mainLayoutStore.collapse, 'active-index': currentIndex === menuInfo.index }"
|
|
|
|
+ @click="$emit('handle')"
|
|
>
|
|
>
|
|
<div class="flex items-center flex-1 menu-padding-left main-layout-sub-menu-title">
|
|
<div class="flex items-center flex-1 menu-padding-left main-layout-sub-menu-title">
|
|
<component
|
|
<component
|
|
@@ -24,7 +25,7 @@
|
|
:index="menuInfo.index"
|
|
:index="menuInfo.index"
|
|
popper-class="main-layout-submenu-popper"
|
|
popper-class="main-layout-submenu-popper"
|
|
class="main-layout-sub-menu"
|
|
class="main-layout-sub-menu"
|
|
- :class="{ 'is-collapse': mainLayoutStore.collapse, 'is-active': currentIndex === menuInfo.index }"
|
|
|
|
|
|
+ :class="{ 'is-collapse': mainLayoutStore.collapse, 'active-index': currentIndex?.startsWith(menu.index) }"
|
|
>
|
|
>
|
|
<template #title>
|
|
<template #title>
|
|
<div class="flex items-center flex-1 main-layout-sub-menu-title" :class="{ 'menu-padding-left': hasChildren }">
|
|
<div class="flex items-center flex-1 main-layout-sub-menu-title" :class="{ 'menu-padding-left': hasChildren }">
|
|
@@ -39,7 +40,12 @@
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<template v-for="child in menuInfo.children" :key="child.key">
|
|
<template v-for="child in menuInfo.children" :key="child.key">
|
|
- <el-menu-item v-if="!child.children?.length" :index="child.index" class="main-layout-menu-item">
|
|
|
|
|
|
+ <el-menu-item
|
|
|
|
+ v-if="!child.children?.length"
|
|
|
|
+ :index="child.index"
|
|
|
|
+ class="main-layout-menu-item"
|
|
|
|
+ :class="{ 'active-index': currentIndex === child.index }"
|
|
|
|
+ >
|
|
<component :is="child.path ? 'router-link' : 'div'" :to="child.path" class="flex items-center flex-1 menu-item">
|
|
<component :is="child.path ? 'router-link' : 'div'" :to="child.path" class="flex items-center flex-1 menu-item">
|
|
<span class="menu-label">{{ child.label }}</span>
|
|
<span class="menu-label">{{ child.label }}</span>
|
|
</component>
|
|
</component>
|
|
@@ -97,7 +103,7 @@ const hasChildren = computed(() => !!menuInfo.value.children.length)
|
|
&:hover {
|
|
&:hover {
|
|
color: $LayoutLeftMenuItemHoverColor;
|
|
color: $LayoutLeftMenuItemHoverColor;
|
|
}
|
|
}
|
|
- &.is-active {
|
|
|
|
|
|
+ &.active-index {
|
|
color: $LayoutLeftMenuItemActiveColor;
|
|
color: $LayoutLeftMenuItemActiveColor;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -113,7 +119,7 @@ const hasChildren = computed(() => !!menuInfo.value.children.length)
|
|
text-align: center;
|
|
text-align: center;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- &.is-active {
|
|
|
|
|
|
+ &.active-index {
|
|
> .main-layout-sub-menu-title,
|
|
> .main-layout-sub-menu-title,
|
|
> .el-sub-menu__title > .main-layout-sub-menu-title {
|
|
> .el-sub-menu__title > .main-layout-sub-menu-title {
|
|
color: $color--primary;
|
|
color: $color--primary;
|
|
@@ -122,7 +128,7 @@ const hasChildren = computed(() => !!menuInfo.value.children.length)
|
|
|
|
|
|
&:not(.is-collapse) {
|
|
&:not(.is-collapse) {
|
|
// &.is-opened,
|
|
// &.is-opened,
|
|
- &.is-active {
|
|
|
|
|
|
+ &.active-index {
|
|
> .main-layout-sub-menu-title,
|
|
> .main-layout-sub-menu-title,
|
|
> .el-sub-menu__title > .main-layout-sub-menu-title {
|
|
> .el-sub-menu__title > .main-layout-sub-menu-title {
|
|
background: $color--primary;
|
|
background: $color--primary;
|