element-ui
导航栏,和path双向改变 :default-active=“this.$route.path”
<el-menu
router
background-color="#304156"
text-color="#bfcbd9"
:default-active="this.$route.path"
class="el-menu-vertical-demo"
@open="handleOpen"
:collapse="isCollapse"
>
<el-submenu :index="item.path" v-for="(item,index) in menuData" :key="index" >
<template slot="title">
<i class="el-icon-menu"></i>
<span class="">{{item.authName}}</span>
</template>
<el-menu-item
:index="tag.path"
v-for="tag in item.children"
:key="tag.id"
@click="fun([item.authName,tag.authName,item.children[0].path],tag)"
>
<i class="el-icon-setting"></i>
<span
slot="title"
>{{tag.authName}}</span>
</el-menu-item>
</el-submenu>
</el-menu>