LeftSideIndex.vue
1.58 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
<template>
<div class="side-bar">
<div class="logo">
<Logo></Logo>
</div>
<div class="side-bar-menu">
<LeftSideMenuLv1 :menuList="menuList"></LeftSideMenuLv1>
<LeftSideMenuLv2></LeftSideMenuLv2>
</div>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import Vue from 'vue'
const bus = new Vue()
export default {
name: 'LeftSideMenu',
computed: {
...mapGetters(['app'])
},
watch: {
'app.currentPage.id': {
handler(n) {
const [lv1, lv2, lv3, lv4] = n.split('-')
bus.$emit('current', { lv1, lv2, lv3, lv4 })
}
}
},
data() {
return {
menuList: []
}
},
created() {
this.menuList = this.app.menuList.noHidden()
},
provide() {
return {
bus
}
}
}
</script>
<style lang="scss" scoped>
@import '~@/assets/style/collapse.scss';
.side-bar {
height: 100%;
display: flex;
flex-direction: column;
overflow: hidden;
background-color: #fff;
> .logo {
flex: 0 0 $logo-height;
height: $logo-height;
}
.side-bar-menu {
flex: 1;
user-select: none;
overflow-y: auto;
background-color: #fff;
padding-top: 36px;
display: flex;
&-left {
height: 100%;
width: $menu-width;
.el-menu {
height: 100%;
}
}
&-scroll-y {
/deep/.el-scrollbar__wrap {
margin-bottom: 0 !important ;
}
height: calc(100vh - #{$logo-height});
}
}
&::before {
position: absolute;
content: '';
width: 1px;
border-right: 1px solid #f5f7fa;
height: 100%;
left: 48px;
}
}
</style>