Skip to content

Commit 2b18b16

Browse files
committed
修改
1 parent 0258429 commit 2b18b16

File tree

3 files changed

+10
-35
lines changed

3 files changed

+10
-35
lines changed

src/components/menus/Menus.vue

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div class="sidebae">
2+
<div class="sidebar">
33
<el-menu
44
class="sidebar-el-menu"
55
:default-active="onRoutes"
@@ -46,12 +46,13 @@ export default {
4646

4747
<style scoped lang="scss">
4848
.sidebar {
49-
display: block;
49+
/* display: block;
5050
position: absolute;
5151
left: 0;
5252
top: 70px;
5353
bottom: 0;
54-
overflow-y: scroll;
54+
overflow-y: scroll; */
55+
float: left;
5556
}
5657
.sidebar::-webkit-scrollbar {
5758
width: 0;
@@ -63,7 +64,4 @@ export default {
6364
.sidebar-el-menu:not(.el-menu--collapse) {
6465
width: 240px;
6566
}
66-
.sidebar > ul {
67-
height: 100%;
68-
}
6967
</style>

src/layout/Layout.vue

Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,16 @@
2121
2222
import AppHeader from './header/Index.vue';
2323
import Sidebar from './sidebar/Index.vue';
24-
import { mapActions } from 'vuex';
24+
import { mapState } from 'vuex';
2525
export default {
2626
components: {
2727
AppHeader,
2828
Sidebar,
2929
},
30-
methods: {
31-
...mapActions(['sidebarOpened'])
30+
computed: {
31+
...mapState({
32+
sidebarOpened: state => state.view.sidebarOpened,
33+
})
3234
}
3335
}
3436
</script>
@@ -40,23 +42,6 @@ export default {
4042
top: 50px;
4143
right: 0;
4244
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-
}
6045
.view {
6146
margin-left: 240px;
6247
background: #f0f0f0;
@@ -65,14 +50,8 @@ export default {
6550
}
6651
}
6752
.sidebar-close {
68-
> * {
69-
transition: all 1s;
70-
}
71-
.sidebar {
72-
transform: translateX(-100%);
73-
}
7453
.view {
75-
margin-left: 0;
54+
margin-left: 64px;
7655
}
7756
}
7857
</style>

src/layout/header/Index.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ export default {
9797
flex-direction: column;
9898
justify-content: center;
9999
align-items: center;
100-
transition: width 0.3s;
101100
.log1 {
102101
width: 240px;
103102
height: 40px;
@@ -127,7 +126,6 @@ export default {
127126
padding: 5px;
128127
margin-top: 4px;
129128
cursor: pointer;
130-
transition: color 0.3s;
131129
}
132130
.trigger:hover {
133131
background: #40a9ff;

0 commit comments

Comments
 (0)