File tree Expand file tree Collapse file tree 2 files changed +35
-1
lines changed Expand file tree Collapse file tree 2 files changed +35
-1
lines changed Original file line number Diff line number Diff line change 3
3
v-if =" item.children && item.children.length"
4
4
:index =" item.index"
5
5
>
6
- <template slot="title">{{ item.title }}</template >
6
+ <span slot =" title" >
7
+ <i :class =" item.icon" ></i >
8
+ {{ item.title }}
9
+ </span >
7
10
<!-- 递归使用该组件 -->
8
11
<template v-for =" (m , i ) in item .children " >
9
12
<MenuItem
24
27
<script >
25
28
26
29
export default {
30
+ name: ' MenuItem' ,
27
31
props: {
28
32
item: Object ,
29
33
default : () => { },
Original file line number Diff line number Diff line change @@ -18,6 +18,36 @@ const state = {
18
18
index : 'tabs' ,
19
19
title : 'tab选项卡'
20
20
} ,
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
+ } ,
21
51
] ,
22
52
} ;
23
53
You can’t perform that action at this time.
0 commit comments