侧边栏点击路由会到用户管理页面,用户管理点击按钮能直接切换到“新建用户”上,上边会再显示一个新建用户,且侧边栏依旧为选中状态


<el-menu :default-active="getActive" class="el-menu-vertical" router></el-menu>
getActive () {
console.log(this.$route.path)
if (this.$route.path === '需要转高亮url') {
return '/demo' // 需要高亮的url
} else {
return this.$route.path
}
}