点击详情进入子路由后父菜单(menu)仍然保持高亮

4 阅读1分钟
<el-menu
   style="border-right:0"  
   :default-active="$route.path"
   background-color="#fff"
   text-color="#717E8C"
   active-text-color="#18A590"
   router
 >
 </el-menu>

将default-active改成下面的

:default-active="'/' +this.$route.path.split('/')[1]"