File tree Expand file tree Collapse file tree 4 files changed +49
-79
lines changed Expand file tree Collapse file tree 4 files changed +49
-79
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
#app {
2
-
3
2
// 主体区域
4
3
.main-container {
5
4
min-height : 100% ;
6
5
transition : margin-left .28s ;
7
6
margin-left : 180px ;
8
7
}
9
-
10
- // 侧边栏
8
+ // 侧边栏
11
9
.sidebar-container {
12
- .horizontal-collapse-transition {
13
- transition : 0s width ease-in-out , 0s padding-left ease-in-out , 0s padding-right ease-in-out ;
14
- }
15
- transition : width .28s ;
10
+ transition : width 0.28s ;
16
11
width : 180px !important ;
17
12
height : 100% ;
18
13
position : fixed ;
22
17
left : 0 ;
23
18
z-index : 1001 ;
24
19
overflow : hidden ;
20
+ // reset element-ui css
21
+ .horizontal-collapse-transition {
22
+ transition : 0s width ease-in-out , 0s padding-left ease-in-out , 0s padding-right ease-in-out ;
23
+ }
24
+ .scrollbar-wrapper {
25
+ height : calc (100% + 15px );
26
+ .el-scrollbar__view {
27
+ height : 100% ;
28
+ }
29
+ }
30
+ .is-horizontal {
31
+ display : none ;
32
+ }
25
33
a {
26
34
display : inline-block ;
27
35
width : 100% ;
36
+ overflow : hidden ;
28
37
}
29
38
.svg-icon {
30
39
margin-right : 16px ;
31
40
}
32
41
.el-menu {
33
42
border : none ;
43
+ height : 100% ;
34
44
width : 100% !important ;
35
45
}
36
46
}
37
-
38
47
.hideSidebar {
39
48
.sidebar-container {
40
49
width : 36px !important ;
50
59
}
51
60
}
52
61
.el-submenu {
62
+ overflow : hidden ;
53
63
& >.el-submenu__title {
54
64
padding-left : 10px !important ;
55
- & >span {
56
- height : 0 ;
57
- width : 0 ;
58
- overflow : hidden ;
59
- visibility : hidden ;
60
- display : inline-block ;
61
- }
62
65
.el-submenu__icon-arrow {
63
66
display : none ;
64
67
}
65
68
}
66
69
}
70
+ .el-menu--collapse {
71
+ .el-submenu {
72
+ & >.el-submenu__title {
73
+ & >span {
74
+ height : 0 ;
75
+ width : 0 ;
76
+ overflow : hidden ;
77
+ visibility : hidden ;
78
+ display : inline-block ;
79
+ }
80
+ }
81
+ }
82
+ }
67
83
}
68
-
69
84
.sidebar-container .nest-menu .el-submenu >.el-submenu__title ,
70
85
.sidebar-container .el-submenu .el-menu-item {
71
86
min-width : 180px !important ;
84
99
margin-left : 0px ;
85
100
}
86
101
.sidebar-container {
87
- top : 50px ;
88
102
transition : transform .28s ;
89
103
width : 180px !important ;
90
104
}
95
109
}
96
110
}
97
111
}
98
-
99
112
.withoutAnimation {
100
113
.main-container ,
101
114
.sidebar-container {
Original file line number Diff line number Diff line change 1
1
<template >
2
2
<div class =" app-wrapper" :class =" classObj" >
3
+ <div v-if =" device==='mobile'&&sidebar.opened" class =" drawer-bg" @click =" handleClickOutside" ></div >
3
4
<sidebar class =" sidebar-container" ></sidebar >
4
5
<div class =" main-container" >
5
6
<navbar ></navbar >
@@ -36,6 +37,11 @@ export default {
36
37
mobile: this .device === ' mobile'
37
38
}
38
39
}
40
+ },
41
+ methods: {
42
+ handleClickOutside () {
43
+ this .$store .dispatch (' closeSideBar' , { withoutAnimation: false })
44
+ }
39
45
}
40
46
}
41
47
</script >
@@ -48,4 +54,13 @@ export default {
48
54
height : 100% ;
49
55
width : 100% ;
50
56
}
57
+ .drawer-bg {
58
+ background : #000 ;
59
+ opacity : 0.3 ;
60
+ width : 100% ;
61
+ top : 0 ;
62
+ height : 100% ;
63
+ position : absolute ;
64
+ z-index : 999 ;
65
+ }
51
66
</style >
Original file line number Diff line number Diff line change 1
1
<template >
2
- <scroll-bar >
2
+ <el-scrollbar wrapClass = " scrollbar-wrapper " >
3
3
<el-menu
4
4
mode =" vertical"
5
5
:show-timeout =" 200"
11
11
>
12
12
<sidebar-item :routes =" permission_routers" ></sidebar-item >
13
13
</el-menu >
14
- </scroll-bar >
14
+ </el-scrollbar >
15
15
</template >
16
16
17
17
<script >
18
18
import { mapGetters } from ' vuex'
19
19
import SidebarItem from ' ./SidebarItem'
20
- import ScrollBar from ' @/components/ScrollBar'
21
20
22
21
export default {
23
- components: { SidebarItem, ScrollBar },
22
+ components: { SidebarItem },
24
23
computed: {
25
24
... mapGetters ([
26
25
' permission_routers' ,
You can’t perform that action at this time.
0 commit comments