<template> <div> <!-- <span>{{listData}}</span> --> <div v-for="item in listData" :key="item.title+'childList'"> <el-menu-item v-if="item.childMenu.length===0" :index="item.title">{{item.title}}</el-menu-item> <el-submenu v-else :index="item.title"> <template slot="title">{{item.title}}</template> <submenu-child :listData="item.childMenu"></submenu-child> </el-submenu> </div> </div></template><script>export default { name: 'SubmenuChild', props: [ 'listData' ],
leftNavData: [ { title:'title1', childMenu: [ { title:'child-title1', childMenu: [ { title: 'child-child-title1', childMenu:[] }, { title: 'child-child-title2', childMenu:[] }, ] }, { title:'child-title2', childMenu:[] } ] }, { title: 'title2', childMenu:[] } ]