Skip to content

Commit 893ea47

Browse files
committed
侧栏收缩
1 parent b6c435d commit 893ea47

File tree

2 files changed

+79
-6
lines changed

2 files changed

+79
-6
lines changed

src/components/Layout.vue

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,35 @@
6161
>.el-submenu__icon-arrow{
6262
display: none;
6363
}
64+
display: -webkit-box;
6465
}
6566
>.el-menu{
66-
display: none;
67+
display: none !important;
6768
}
6869
&:hover{
70+
>.el-submenu__title{
71+
>span{
72+
margin-left: 22px;
73+
-moz-box-flex:1.0;
74+
-webkit-box-flex: 1.0;
75+
display: block;
76+
}
77+
>.el-submenu__icon-arrow{
78+
padding-top: 5px;
79+
display: block;
80+
}
81+
background-color: #222d32;
82+
width: 230px;
83+
border-top-right-radius: 4px;
84+
}
6985
>.el-menu{
70-
display: block;
86+
display: block !important;
7187
position: absolute;
88+
width: 150px;
7289
left: 50px;
90+
padding-top: 5px;
91+
padding-bottom: 5px;
92+
border-bottom-right-radius: 4px;
7393
}
7494
}
7595
}
@@ -90,7 +110,7 @@
90110
/* 收缩侧栏后的样式end */
91111
}
92112
.layout-sidebar-left{
93-
width: 200px;
113+
width: 230px;
94114
}
95115
.layout-right{
96116
-moz-box-flex:1.0;

src/components/Layout/Sidebar.vue

Lines changed: 56 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,17 @@
33
<div class="layout-logo-lg">CoreCMF</div>
44
<div class="layout-logo-mini">Core</div>
55
<el-menu default-active="1-4-1" theme="dark" class="sidebar-menu">
6+
<div class="user-panel">
7+
<div class="pull-left image">
8+
<img src="https://adminlte.io/themes/AdminLTE/dist/img/user2-160x160.jpg" class="img-circle" alt="User Image">
9+
</div>
10+
<div class="pull-left info">
11+
<p>Alexander Pierce</p>
12+
<a href="#"><i class="fa fa-circle text-success"></i> Online</a>
13+
</div>
14+
</div>
615
<el-submenu index="1">
7-
<template slot="title"><i class="el-icon-message"></i><span>导航一</span></template>
16+
<template slot="title"><i class="el-icon-message"></i><span>Dashboard</span></template>
817
<el-menu-item index="1-1">选项1</el-menu-item>
918
<el-menu-item index="1-2">选项2</el-menu-item>
1019
<el-menu-item index="1-3">选项3</el-menu-item>
@@ -74,7 +83,7 @@
7483
}
7584
.sidebar-menu {
7685
position: fixed;
77-
width:200px;
86+
width:230px;
7887
min-height: 100%;
7988
top: 50px;
8089
bottom:0;
@@ -87,6 +96,11 @@
8796
}
8897
.el-menu--dark{
8998
background-color: #222d32!important;
99+
>.is-active{
100+
>.el-submenu__title{
101+
border-left-color: #dd4b39;
102+
}
103+
}
90104
}
91105
.el-submenu__title{
92106
height: 44px!important;
@@ -100,11 +114,50 @@
100114
background-color: #2c3b41!important;
101115
}
102116
.el-menu--dark .el-menu-item, .el-menu--dark .el-submenu__title{
117+
border-left: 3px solid transparent;
103118
color: #b8c7ce;
104119
}
105120
.el-menu--horizontal.el-menu--dark .el-submenu .el-menu-item.is-active, .el-menu-item.is-active{
106121
color:#fff;
107122
}
108123
/** 对饿了么菜单框架配色进行调整end **/
109-
124+
.user-panel{
125+
position:relative;
126+
height: 45px;
127+
padding: 10px;
128+
position:relative;
129+
>.pull-left{
130+
float:left;
131+
}
132+
>.image{
133+
>img{
134+
width:100%;
135+
max-width: 45px;
136+
height: auto;
137+
}
138+
>.img-circle{
139+
border-radius: 50%;
140+
}
141+
}
142+
>.info{
143+
>a{
144+
color: #fff;
145+
text-decoration: none;
146+
padding-right: 5px;
147+
margin-top: 3px;
148+
font-size: 11px;
149+
}
150+
>p{
151+
font-weight: 600;
152+
margin-bottom: 9px;
153+
}
154+
padding:5px 5px 5px 15px;
155+
line-height: 1;
156+
position: absolute;
157+
left: 55px;
158+
}
159+
.text-success{
160+
color: #3c763d;
161+
}
162+
}
110163
</style>

0 commit comments

Comments
 (0)