Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
W
web-monitor
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
web-monitor
Commits
e2fd7c75
Commit
e2fd7c75
authored
Jun 15, 2020
by
花裤衩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat[Menu]: menu icon support el-icon
parent
5c877720
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
3 deletions
+32
-3
Item.vue
src/layout/components/Sidebar/Item.vue
+13
-1
index.js
src/router/index.js
+2
-2
sidebar.scss
src/styles/sidebar.scss
+17
-0
No files found.
src/layout/components/Sidebar/Item.vue
View file @
e2fd7c75
...
@@ -17,7 +17,11 @@ export default {
...
@@ -17,7 +17,11 @@ export default {
const
vnodes
=
[]
const
vnodes
=
[]
if
(
icon
)
{
if
(
icon
)
{
vnodes
.
push
(
<
svg
-
icon
icon
-
class
=
{
icon
}
/>
)
if
(
icon
.
includes
(
'el-icon'
))
{
vnodes
.
push
(
<
i
class
=
{[
icon
,
'sub-el-icon'
]}
/>
)
}
else
{
vnodes
.
push
(
<
svg
-
icon
icon
-
class
=
{
icon
}
/>
)
}
}
}
if
(
title
)
{
if
(
title
)
{
...
@@ -27,3 +31,11 @@ export default {
...
@@ -27,3 +31,11 @@ export default {
}
}
}
}
</
script
>
</
script
>
<
style
scoped
>
.sub-el-icon
{
color
:
currentColor
;
width
:
1em
;
height
:
1em
;
}
</
style
>
src/router/index.js
View file @
e2fd7c75
...
@@ -19,7 +19,7 @@ import Layout from '@/layout'
...
@@ -19,7 +19,7 @@ import Layout from '@/layout'
* meta : {
* meta : {
roles: ['admin','editor'] control the page roles (you can set multiple roles)
roles: ['admin','editor'] control the page roles (you can set multiple roles)
title: 'title' the name show in sidebar and breadcrumb (recommend set)
title: 'title' the name show in sidebar and breadcrumb (recommend set)
icon: 'svg-name'
the icon show in the sidebar
icon: 'svg-name'
/'el-icon-x'
the icon show in the sidebar
breadcrumb: false if set false, the item will hidden in breadcrumb(default is true)
breadcrumb: false if set false, the item will hidden in breadcrumb(default is true)
activeMenu: '/example/list' if set path, the sidebar will highlight the path you set
activeMenu: '/example/list' if set path, the sidebar will highlight the path you set
}
}
...
@@ -60,7 +60,7 @@ export const constantRoutes = [
...
@@ -60,7 +60,7 @@ export const constantRoutes = [
component
:
Layout
,
component
:
Layout
,
redirect
:
'/example/table'
,
redirect
:
'/example/table'
,
name
:
'Example'
,
name
:
'Example'
,
meta
:
{
title
:
'Example'
,
icon
:
'e
xample
'
},
meta
:
{
title
:
'Example'
,
icon
:
'e
l-icon-s-help
'
},
children
:
[
children
:
[
{
{
path
:
'table'
,
path
:
'table'
,
...
...
src/styles/sidebar.scss
View file @
e2fd7c75
...
@@ -57,6 +57,11 @@
...
@@ -57,6 +57,11 @@
margin-right
:
16px
;
margin-right
:
16px
;
}
}
.sub-el-icon
{
margin-right
:
12px
;
margin-left
:
-2px
;
}
.el-menu
{
.el-menu
{
border
:
none
;
border
:
none
;
height
:
100%
;
height
:
100%
;
...
@@ -105,6 +110,10 @@
...
@@ -105,6 +110,10 @@
.svg-icon
{
.svg-icon
{
margin-left
:
20px
;
margin-left
:
20px
;
}
}
.sub-el-icon
{
margin-left
:
19px
;
}
}
}
}
}
...
@@ -118,6 +127,10 @@
...
@@ -118,6 +127,10 @@
margin-left
:
20px
;
margin-left
:
20px
;
}
}
.sub-el-icon
{
margin-left
:
19px
;
}
.el-submenu__icon-arrow
{
.el-submenu__icon-arrow
{
display
:
none
;
display
:
none
;
}
}
...
@@ -178,6 +191,10 @@
...
@@ -178,6 +191,10 @@
.svg-icon
{
.svg-icon
{
margin-right
:
16px
;
margin-right
:
16px
;
}
}
.sub-el-icon
{
margin-right
:
12px
;
margin-left
:
-2px
;
}
}
}
.nest-menu
.el-submenu
>
.el-submenu__title
,
.nest-menu
.el-submenu
>
.el-submenu__title
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment