MrShi
3 天以前 43dc204f89527ba402666ba92345efbfe751f297
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<template>
  <el-menu-item v-if="menu.children == null || menu.children.length == 0" :key="menu.index" :index="menu.index">
    <i :class="menu.icon"></i>
    <span slot="title">{{menu.label}}</span>
  </el-menu-item>
  <el-submenu v-else :index="menu.index">
    <template slot="title">
      <i :class="menu.icon" style="color: #333333 !important"></i>
      <span slot="title">{{menu.label}}</span>
    </template>
    <MenuItems v-for="child in menu.children" :menu="child" :key="child.index"/>
  </el-submenu>
</template>
 
<script>
export default {
  name: 'MenuItems',
  props: {
    menu: {
      type: Object,
      required: true
    }
  }
}
</script>