File tree Expand file tree Collapse file tree 3 files changed +44
-19
lines changed Expand file tree Collapse file tree 3 files changed +44
-19
lines changed Original file line number Diff line number Diff line change 11<template >
2- <div class =" layout " >
3- <div class =" layout-menu -left" >
2+ <div class =" layout" :class = " { hideSidebar: isSidebar } " >
3+ <div class =" layout-sidebar -left" >
44 <layout-sidebar />
55 </div >
66 <div class =" layout-right" >
7- <layout-navbar />
7+ <layout-navbar v-on:sidebar = " toggleClick " />
88 <layout-breadcrumb />
99 <layout-content />
1010 <layout-footer />
2525 layoutBreadcrumb,
2626 layoutContent,
2727 layoutFooter
28+ },
29+ data () {
30+ return {
31+ isSidebar: false
32+ }
33+ },
34+ methods: {
35+ toggleClick () {
36+ this .isSidebar = ! this .isSidebar
37+ }
2838 }
2939 }
3040 </script >
3848 overflow : hidden ;
3949 display : -webkit-box ;
4050 & .hideSidebar {
41- >.layout-menu -left {
51+ >.layout-sidebar -left {
4252 width : 50px ;
4353 >.sidebar-container {
44- width :50px ;
54+ >.layout-logo-lg {
55+ display : none ;
56+ }
57+ >.layout-logo-mini {
58+ display : block ;
59+ }
60+ >.sidebar-menu {
61+ width :50px ;
62+ }
4563 }
4664 }
4765 }
4866 }
49- .layout-menu -left {
67+ .layout-sidebar -left {
5068 width : 200px ;
5169 }
5270 .layout-right {
Original file line number Diff line number Diff line change 1313 name: ' navbar' ,
1414 methods: {
1515 toggleClick () {
16- console . log ( ' test ' )
16+ this . $emit ( ' sidebar ' )
1717 }
1818 }
1919 }
Original file line number Diff line number Diff line change 11<template >
2- <div >
3- <div class =" layout-logo-left" >CoreCMF</div >
4- <el-menu default-active =" 1-4-1" theme =" dark" class =" sidebar-container" >
2+ <div class =" sidebar-container" >
3+ <div class =" layout-logo-lg" >CoreCMF</div >
4+ <div class =" layout-logo-mini" >Core</div >
5+ <el-menu default-active =" 1-4-1" theme =" dark" class =" sidebar-menu" >
56 <el-submenu index =" 1" >
6- <template slot="title">导航一</template >
7+ <template slot="title">< i class = " el-icon-message " ></ i > 导航一</template >
78 <el-menu-item-group title =" 分组一" >
89 <el-menu-item index =" 1-1" >选项1</el-menu-item >
910 <el-menu-item index =" 1-2" >选项2</el-menu-item >
5657 </script >
5758<style lang="scss" scoped>
5859 @import ' ./../../assets/sass/mixin.scss' ;
59- .layout-logo-left {
60+ .layout-logo-lg {
6061 background-color : #d73925 ;
6162 height : 50px ;
6263 line-height : 50px ;
6566 text-align : center ;
6667 width : 100% ;
6768 }
68- .sidebar-container {
69+ .layout-logo-mini {
70+ background-color : #d73925 ;
71+ height : 50px ;
72+ line-height : 50px ;
73+ font-size : 20px ;
74+ color : #fff ;
75+ text-align : center ;
76+ width : 100% ;
77+ display : none ;
78+ }
79+ .sidebar-menu {
6980 position : fixed ;
7081 width :200px ;
7182 min-height : 100% ;
7485 overflow-x : hidden ;
7586 @include scrollBar ;
7687 }
77- .el-submenu__title {
78- background-color : #d73925 ;
88+ .el-menu {
89+ border-radius : 0 px ;
7990 }
80- .el-submenu {
8191
82- // background-color: #d73925;
83- border-right-color : #dd4b39 ;
84- }
8592 </style >
You can’t perform that action at this time.
0 commit comments