You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

38 lines
835 B

<template>
<div>
<template v-for="(item, i) in this.menuList">
<el-submenu :key="item.id"
:index="item.id.toString()"
v-if="item.children && item.children.length">
<template slot="title">
<span slot="title">{{item.name}}</span>
</template>
<menuTree :menuList="item.children"></menuTree>
</el-submenu>
<el-menu-item :key="i"
:index="item.id.toString()"
v-else>
<span slot="title">{{item.name}}</span>
</el-menu-item>
</template>
</div>
</template>
<script>
export default {
name: 'menuTree',
props: {
menuList: {
type: Array,
default: []
}
},
data () {
return {}
},
mounted () { },
methods: {}
}
</script>
<style lang="scss" scoped>
</style>