File tree Expand file tree Collapse file tree 3 files changed +10
-35
lines changed Expand file tree Collapse file tree 3 files changed +10
-35
lines changed Original file line number Diff line number Diff line change 1
1
<template >
2
- <div class =" sidebae " >
2
+ <div class =" sidebar " >
3
3
<el-menu
4
4
class =" sidebar-el-menu"
5
5
:default-active =" onRoutes"
@@ -46,12 +46,13 @@ export default {
46
46
47
47
<style scoped lang="scss">
48
48
.sidebar {
49
- display : block ;
49
+ /* display: block;
50
50
position: absolute;
51
51
left: 0;
52
52
top: 70px;
53
53
bottom: 0;
54
- overflow-y : scroll ;
54
+ overflow-y: scroll; */
55
+ float : left ;
55
56
}
56
57
.sidebar ::-webkit-scrollbar {
57
58
width : 0 ;
@@ -63,7 +64,4 @@ export default {
63
64
.sidebar-el-menu :not (.el-menu--collapse ) {
64
65
width : 240px ;
65
66
}
66
- .sidebar > ul {
67
- height : 100% ;
68
- }
69
67
</style >
Original file line number Diff line number Diff line change 21
21
22
22
import AppHeader from ' ./header/Index.vue' ;
23
23
import Sidebar from ' ./sidebar/Index.vue' ;
24
- import { mapActions } from ' vuex' ;
24
+ import { mapState } from ' vuex' ;
25
25
export default {
26
26
components: {
27
27
AppHeader,
28
28
Sidebar,
29
29
},
30
- methods: {
31
- ... mapActions ([' sidebarOpened' ])
30
+ computed: {
31
+ ... mapState ({
32
+ sidebarOpened : state => state .view .sidebarOpened ,
33
+ })
32
34
}
33
35
}
34
36
</script >
@@ -40,23 +42,6 @@ export default {
40
42
top : 50px ;
41
43
right : 0 ;
42
44
bottom : 0 ;
43
- > * {
44
- transition : all 1s ;
45
- }
46
- .sidebar {
47
- width : 230px ;
48
- height : inherit ;
49
- background : #fff ;
50
- box-shadow : 0 0 1.2em rgba (0 , 0 , 0 , 0.12 );
51
- margin-right : 10px ;
52
- overflow-y : auto ;
53
- position : fixed ;
54
- left : 0 ;
55
- bottom : 0 ;
56
- top : 50px ;
57
- right : 0 ;
58
- transform : translateX (0 );
59
- }
60
45
.view {
61
46
margin-left : 240px ;
62
47
background : #f0f0f0 ;
@@ -65,14 +50,8 @@ export default {
65
50
}
66
51
}
67
52
.sidebar-close {
68
- > * {
69
- transition : all 1s ;
70
- }
71
- .sidebar {
72
- transform : translateX (-100% );
73
- }
74
53
.view {
75
- margin-left : 0 ;
54
+ margin-left : 64 px ;
76
55
}
77
56
}
78
57
</style >
Original file line number Diff line number Diff line change @@ -97,7 +97,6 @@ export default {
97
97
flex-direction : column ;
98
98
justify-content : center ;
99
99
align-items : center ;
100
- transition : width 0.3s ;
101
100
.log1 {
102
101
width : 240px ;
103
102
height : 40px ;
@@ -127,7 +126,6 @@ export default {
127
126
padding : 5px ;
128
127
margin-top : 4px ;
129
128
cursor : pointer ;
130
- transition : color 0.3s ;
131
129
}
132
130
.trigger :hover {
133
131
background : #40a9ff ;
You can’t perform that action at this time.
0 commit comments