File tree 3 files changed +33
-4
lines changed
3 files changed +33
-4
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,11 @@ export default {
17
17
const vnodes = []
18
18
19
19
if (icon) {
20
- vnodes .push (< svg- icon icon- class = {icon}/ > )
20
+ if (icon .includes (' el-icon' )) {
21
+ vnodes .push (< i class = {[icon, ' sub-el-icon' ]} / > )
22
+ } else {
23
+ vnodes .push (< svg- icon icon- class = {icon}/ > )
24
+ }
21
25
}
22
26
23
27
if (title) {
@@ -27,3 +31,11 @@ export default {
27
31
}
28
32
}
29
33
</script >
34
+
35
+ <style scoped>
36
+ .sub-el-icon {
37
+ color : currentColor ;
38
+ width : 1em ;
39
+ height : 1em ;
40
+ }
41
+ </style >
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ import nestedRouter from './modules/nested'
25
25
* meta : {
26
26
roles: ['admin','editor'] control the page roles (you can set multiple roles)
27
27
title: 'title' the name show in sidebar and breadcrumb (recommend set)
28
- icon: 'svg-name' the icon show in the sidebar
28
+ icon: 'svg-name'/'el-icon-x' the icon show in the sidebar
29
29
noCache: true if set true, the page will no be cached(default is false)
30
30
affix: true if set true, the tag will affix in the tags-view
31
31
breadcrumb: false if set false, the item will hidden in breadcrumb(default is true)
@@ -197,14 +197,14 @@ export const asyncRoutes = [
197
197
name : 'Example' ,
198
198
meta : {
199
199
title : 'Example' ,
200
- icon : 'example '
200
+ icon : 'el-icon-s-help '
201
201
} ,
202
202
children : [
203
203
{
204
204
path : 'create' ,
205
205
component : ( ) => import ( '@/views/example/create' ) ,
206
206
name : 'CreateArticle' ,
207
- meta : { title : 'Create Article' , icon : 'edit ' }
207
+ meta : { title : 'Create Article' , icon : 'el-icon-s-help ' }
208
208
} ,
209
209
{
210
210
path : 'edit/:id(\\d+)' ,
Original file line number Diff line number Diff line change 57
57
margin-right : 16px ;
58
58
}
59
59
60
+ .sub-el-icon {
61
+ margin-right : 12px ;
62
+ margin-left : -2px ;
63
+ }
64
+
60
65
.el-menu {
61
66
border : none ;
62
67
height : 100% ;
105
110
.svg-icon {
106
111
margin-left : 20px ;
107
112
}
113
+
114
+ .sub-el-icon {
115
+ margin-left : 19px ;
116
+ }
108
117
}
109
118
}
110
119
118
127
margin-left : 20px ;
119
128
}
120
129
130
+ .sub-el-icon {
131
+ margin-left : 19px ;
132
+ }
133
+
121
134
.el-submenu__icon-arrow {
122
135
display : none ;
123
136
}
178
191
.svg-icon {
179
192
margin-right : 16px ;
180
193
}
194
+ .sub-el-icon {
195
+ margin-right : 12px ;
196
+ margin-left : -2px ;
197
+ }
181
198
}
182
199
183
200
.nest-menu .el-submenu >.el-submenu__title ,
You can’t perform that action at this time.
0 commit comments