LeftSideMenuLv3.vue
1.78 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
<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>
import { currentId } from './mixins/index'
export default {
name: 'LeftSideMenuLv3',
inject: ['bus'],
mixins: [currentId],
props: {
menuItems: {
type: Array,
required: true
}
},
methods: {
handleSelect({ path, children = [], id }) {
const { lv1, lv2, lv3 } = this.current
if (id == `${lv1}-${lv2}-${lv3}`) return
if (path && path.startsWith('/') && !path.startsWith('/^')) {
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;
margin-bottom: 1px;
::v-deep.el-menu-item-group__title {
display: none;
}
::v-deep ul {
display: flex;
flex-direction: column;
align-items: center;
gap: 1px;
.el-menu-item {
width: 100% !important;
min-width: 100% !important;
height: 36px;
line-height: 36px;
align-self: center;
border-radius: 4px;
// padding-left: 0 !important;
padding: 0 0 0 32px !important;
span {
@include menu-title-span-haspage;
font-size: 14px;
}
&.is-active {
@include menu-highlight;
span {
color: $main-color !important;
}
}
&:not(.is-active):hover {
@include menu-title-hover;
}
}
}
}
</style>