File tree Expand file tree Collapse file tree 3 files changed +33
-4
lines changed Expand file tree Collapse file tree 3 files changed +33
-4
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,11 @@ export default {
1717 const vnodes = []
1818
1919 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+ }
2125 }
2226
2327 if (title) {
@@ -27,3 +31,11 @@ export default {
2731 }
2832}
2933 </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'
2525 * meta : {
2626 roles: ['admin','editor'] control the page roles (you can set multiple roles)
2727 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
2929 noCache: true if set true, the page will no be cached(default is false)
3030 affix: true if set true, the tag will affix in the tags-view
3131 breadcrumb: false if set false, the item will hidden in breadcrumb(default is true)
@@ -197,14 +197,14 @@ export const asyncRoutes = [
197197 name : 'Example' ,
198198 meta : {
199199 title : 'Example' ,
200- icon : 'example '
200+ icon : 'el-icon-s-help '
201201 } ,
202202 children : [
203203 {
204204 path : 'create' ,
205205 component : ( ) => import ( '@/views/example/create' ) ,
206206 name : 'CreateArticle' ,
207- meta : { title : 'Create Article' , icon : 'edit ' }
207+ meta : { title : 'Create Article' , icon : 'el-icon-s-help ' }
208208 } ,
209209 {
210210 path : 'edit/:id(\\d+)' ,
Original file line number Diff line number Diff line change 5757 margin-right : 16px ;
5858 }
5959
60+ .sub-el-icon {
61+ margin-right : 12px ;
62+ margin-left : -2px ;
63+ }
64+
6065 .el-menu {
6166 border : none ;
6267 height : 100% ;
105110 .svg-icon {
106111 margin-left : 20px ;
107112 }
113+
114+ .sub-el-icon {
115+ margin-left : 19px ;
116+ }
108117 }
109118 }
110119
118127 margin-left : 20px ;
119128 }
120129
130+ .sub-el-icon {
131+ margin-left : 19px ;
132+ }
133+
121134 .el-submenu__icon-arrow {
122135 display : none ;
123136 }
178191 .svg-icon {
179192 margin-right : 16px ;
180193 }
194+ .sub-el-icon {
195+ margin-right : 12px ;
196+ margin-left : -2px ;
197+ }
181198 }
182199
183200 .nest-menu .el-submenu >.el-submenu__title ,
You can’t perform that action at this time.
0 commit comments