LeftSideMenuLv3.vue
2.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<template>
<el-menu-item-group class="com-left-side-menu-lv3" v-if="menuItems">
<el-menu-item v-for="item in menuItems.noHidden()" :key="item.id" :index="item.id" @click.native.stop="handleSelect(item)">
<span>{{ item.title }}</span>
</el-menu-item>
</el-menu-item-group>
</template>
<script>
export default {
name: 'LeftSideMenuLv3',
inject: ['bus'],
props: {
menuItems: {
type: Array,
required: true
}
},
methods: {
handleSelect({ path, children = [] }) {
if (path) {
this.$router.push(path)
this.bus.$emit('menu3Changed', children.noHidden())
}
}
}
}
</script>
<style lang="scss" scoped>
@import '~@/assets/style/collapse.scss';
@import '~@/assets/style/mixins.scss';
$menu-item-width: 144px !important;
.com-left-side-menu-lv3 {
width: $menu-item-width !important;
/deep/.el-menu-item-group__title {
display: none;
}
/deep/ul {
display: flex;
flex-direction: column;
align-items: center;
.el-menu-item {
width: 100% !important;
min-width: 100% !important;
height: 32px;
line-height: 32px;
align-self: center;
border-radius: 4px;
// padding-left: 0 !important;
padding: 0 8px !important;
span {
color: #777;
font-size: 14px;
}
&:hover,
&.is-active {
@include menu-highlight;
span {
color: $main-color !important;
}
}
&:hover:not(.is-active) {
background-color: transparent !important;
}
}
}
}
</style>
<style lang="scss">
$width: 150px;
@mixin popup_width {
width: $width !important;
min-width: $width !important;
}
.el-menu--vertical {
&.el-submenu-popper-base {
.el-menu--popup {
@include popup_width;
margin-left: -8px;
box-shadow: 0px 6px 20px 0px rgba(122, 122, 122, 0.2);
border-radius: 4px;
.scrm-base-submenu-item {
.el-menu-item {
@include popup_width;
padding-left: 20px !important;
border-radius: 0;
}
.el-menu-item-group__title {
display: block;
}
}
}
}
}
</style>