Skip to content

Commit 9b563f6

Browse files
committed
配置菜单图标
1 parent 05e19eb commit 9b563f6

File tree

2 files changed

+35
-1
lines changed

2 files changed

+35
-1
lines changed

src/components/menus/MenuItem.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
v-if="item.children && item.children.length"
44
:index="item.index"
55
>
6-
<template slot="title">{{ item.title }}</template>
6+
<span slot="title">
7+
<i :class="item.icon"></i>
8+
{{ item.title }}
9+
</span>
710
<!-- 递归使用该组件 -->
811
<template v-for="(m, i) in item.children">
912
<MenuItem
@@ -24,6 +27,7 @@
2427
<script>
2528
2629
export default {
30+
name: 'MenuItem',
2731
props: {
2832
item: Object,
2933
default: () => { },

src/store/modules/view.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,36 @@ const state = {
1818
index: 'tabs',
1919
title: 'tab选项卡'
2020
},
21+
{
22+
icon: 'el-icon-folder-opened',
23+
index: '3',
24+
title: '表单相关',
25+
children: [
26+
{
27+
index: 'form',
28+
title: '基本表单',
29+
icon: 'el-icon-s-data',
30+
},
31+
{
32+
index: '3-2',
33+
title: '三级菜单',
34+
children: [
35+
{
36+
index: 'editor',
37+
title: '富文本编辑器'
38+
},
39+
{
40+
index: 'markdown',
41+
title: 'markdown编辑器'
42+
}
43+
]
44+
},
45+
{
46+
index: 'upload',
47+
title: '文件上传'
48+
}
49+
]
50+
},
2151
],
2252
};
2353

0 commit comments

Comments
 (0)