Skip to content

Commit 600485f

Browse files
committed
修复左侧菜单隐藏与显示
1 parent 7562662 commit 600485f

File tree

1 file changed

+26
-14
lines changed

1 file changed

+26
-14
lines changed

src/components/framement/Framement.vue

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
<div class="header">
44
<app-header></app-header>
55
</div>
6-
<div class="content">
7-
<div
8-
class="sidebar"
9-
:class="{'sidebar-close': sidebarOpened}"
10-
>
6+
<div
7+
class="content"
8+
:class="{'sidebar-close': sidebarOpened}"
9+
>
10+
<div class="sidebar">
1111
<app-sidebar></app-sidebar>
1212
</div>
1313
<div class="view">
@@ -37,8 +37,9 @@ export default class Framement extends Vue {
3737
top: 50px;
3838
right: 0;
3939
bottom: 0;
40-
display: flex;
41-
flex-direction: row;
40+
> * {
41+
transition: all 1s;
42+
}
4243
.sidebar {
4344
width: 240px;
4445
height: inherit;
@@ -47,18 +48,29 @@ export default class Framement extends Vue {
4748
box-shadow: 0 0 1.2em rgba(0, 0, 0, 0.12);
4849
margin-right: 10px;
4950
overflow-y: auto;
50-
transition: width 1s;
51-
}
52-
.sidebar-close {
53-
width: 0;
54-
transition: width 1s;
55-
margin-right: 0;
51+
position: fixed;
52+
left: 0;
53+
bottom: 0;
54+
top: 50px;
55+
right: 0;
56+
transform: translateX(0);
5657
}
5758
.view {
58-
flex: 1;
59+
margin-left: 240px;
5960
background: #e5e5e5;
6061
height: inherit;
6162
padding: 2rem;
6263
}
6364
}
65+
.sidebar-close {
66+
> * {
67+
transition: all 1s;
68+
}
69+
.sidebar {
70+
transform: translateX(-100%);
71+
}
72+
.view {
73+
margin-left: 0;
74+
}
75+
}
6476
</style>

0 commit comments

Comments
 (0)