This repository was archived by the owner on May 12, 2020. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -52,7 +52,6 @@ export default {
5252 font-family : ' Avenir' , Helvetica , Arial , sans-serif ;
5353 -webkit-font-smoothing : antialiased ;
5454 -moz-osx-font-smoothing : grayscale ;
55- text-align : center ;
5655 color : #2c3e50 ;
5756}
5857#nav {
Original file line number Diff line number Diff line change 11<template >
22 <el-aside
33 class =" layout__material__aside"
4- width =" 254px"
4+ : width =" $store.state.isAsideCollapse ? ` 254px` : `80px` "
55 >
66 material aside
77 </el-aside >
88</template >
99
1010<script >
1111export default {
12- data () {
13- return {}
14- }
1512}
1613 </script >
1714
1815<style lang='scss' scoped>
16+ @import ' ~STYLE/color/background.scss' ;
17+
18+ .layout__material__aside {
19+ min-height : 100vh ;
20+ background-color : $background-dark ;
21+ transition : width .3s ;
22+ }
1923 </style >
Original file line number Diff line number Diff line change 1+ <template >
2+ <el-header class =" layout__material__header" >
3+ <i
4+ class =" el-icon-menu header__icon"
5+ @click =" toggleAside"
6+ ></i >
7+ <el-button
8+ class =" logout"
9+ type =" text"
10+ @click =" onLogout"
11+ >Logout</el-button >
12+ <el-button
13+ class =" logout"
14+ type =" text"
15+ @click =" $router.push('/pages/admin/dashboard')"
16+ >dashboard</el-button >
17+ <el-button
18+ class =" logout"
19+ type =" text"
20+ @click =" $router.push('/pages/admin/table')"
21+ >table</el-button >
22+ <el-button
23+ class =" logout"
24+ type =" text"
25+ @click =" $router.push('/pages/common/user')"
26+ >user info</el-button >
27+ </el-header >
28+ </template >
29+
30+ <script >
31+ import { mapMutations } from ' vuex'
32+
33+ export default {
34+ methods: {
35+ onLogout () {
36+ this .$store .dispatch (' login/userLogout' )
37+ .then (() => this .$router .replace (' /login' ))
38+ },
39+ ... mapMutations ({
40+ toggleAside: ' SET_ASIDE_COLLAPSE'
41+ })
42+ }
43+ }
44+ </script >
45+
46+ <style lang='scss' scoped>
47+ @import ' ~STYLE/color/background.scss' ;
48+
49+ .layout__material__header {
50+ padding : 0 24px 0 0 ;
51+ position : relative ; // for box-shadow
52+ background-color : $background-lightest ;
53+ box-shadow : 0 1px 4px rgba (0 ,21 ,41 ,.08 );
54+
55+ .header {
56+ & __icon {
57+ padding : 0 24px ;
58+ line-height : 60px ;
59+ cursor : pointer ;
60+ font-size : 20px ;
61+ transition : all .3s , padding 0s ;
62+ }
63+ }
64+ }
65+ </style >
Original file line number Diff line number Diff line change 44 <material-aside />
55
66 <el-container class =" layout__material__placeholder" >
7- <el-header >
8- <el-button
9- class =" logout"
10- type =" text"
11- @click =" onLogout"
12- >Logout</el-button >
13- <el-button
14- class =" logout"
15- type =" text"
16- @click =" $router.push('/pages/admin/dashboard')"
17- >dashboard</el-button >
18- <el-button
19- class =" logout"
20- type =" text"
21- @click =" $router.push('/pages/admin/table')"
22- >table</el-button >
23- <el-button
24- class =" logout"
25- type =" text"
26- @click =" $router.push('/pages/common/user')"
27- >user info</el-button >
28- </el-header >
7+ <material-header />
298
309 <el-main class =" layout__material__placeholder-main" >
3110 <router-view />
3918</template >
4019
4120<script >
21+ import MaterialHeader from ' ./Header'
4222import MaterialAside from ' ./Aside'
4323
4424export default {
45- methods: {
46- onLogout () {
47- this .$store .dispatch (' login/userLogout' )
48- .then (() => this .$router .replace (' /login' ))
49- }
50- },
51-
5225 computed: {
5326 currentYear () {
5427 return new Date ().getFullYear ()
5528 }
5629 },
5730
5831 components: {
32+ MaterialHeader,
5933 MaterialAside
6034 }
6135}
@@ -75,6 +49,7 @@ export default {
7549
7650 & __footer {
7751 line-height : 60px ;
52+ text-align : center ;
7853 }
7954}
8055 </style >
Original file line number Diff line number Diff line change 1- // import types from './types'
1+ import types from './types'
22
3- export default { }
3+ export default {
4+ [ types . SET_ASIDE_COLLAPSE ] ( state ) {
5+ state . isAsideCollapse = ! state . isAsideCollapse
6+ }
7+ }
Original file line number Diff line number Diff line change 1- export default { }
1+ export default {
2+ SET_ASIDE_COLLAPSE : 'SET_ASIDE_COLLAPSE'
3+ }
Original file line number Diff line number Diff line change 1- export default { }
1+ export default {
2+ isAsideCollapse : false
3+ }
You can’t perform that action at this time.
0 commit comments