父组件
<el-menu :default-active="this.$route.path"
class="el-menu-vertical-demo"
background-color="#304156"
text-color="#fff"
collapse-transition=true
active-text-color="#409eff"
align = 'laft'
show-timeout = '0'
hide-timeout='0'
router
@select="handleSelect"
:collapse="isCollapse"
unique-opened = true
@open='aa'
>
<menutree :data="getpowertrees" ></menutree>
</el-menu>
子组件
<template>
<div class="menutree">
<label v-for="menu in data" :key="menu.id">
<el-submenu :index="menu.powerName" v-if="menu.childs">
<template slot="title">
<i class="el-icon-s-home"></i>
<span>{{menu.powerName}}</span>
</template>
<label>
<menutree :data="menu.childs"></menutree>
</label>
</el-submenu>
<el-menu-item v-else :index="menu.powerPath">
<i class="el-icon-s-home"></i>
<span slot="title">{{menu.powerName}}</span>
</el-menu-item>
</label>
</div>
</template>