<template>
    <div>
        <template v-for="child in elList.leftMenus">
            <el-menu-item v-if="!child.leftMenus" :key="child.id" :index=child.id @click.native="parent._goto(child.uri);parent._changeMenu(child)">
                <i class="el-icon-menu"></i>
                <span slot="title">{{child.name}}</span>
            </el-menu-item>
            <el-submenu v-else :key="child.id" :index="child.id">
                <template slot="title">
                    <i class="el-icon-menu"></i>
                    <span slot="title"> {{child.name}}</span>
                </template>
                <!--  循环 递归组件 -->
                <nav-tree :el-list="child"></nav-tree>
            </el-submenu>
        </template>
    </div>
</template>

<script>
export default {
  name: 'NavTree',
  props: ['elList'],
  inject: ['parent']
}
</script>
<style scoped>
</style>
