1.添加router
2.在item中的index配置对应router的path
3.完事
<el-menu :default-active="$route.path" class="el-menu-demo" router mode="horizontal">
<!-- @select="handleSelect" 注意这个就不用了-->
<el-menu-item index="/home/webAhead">首页</el-menu-item>
<el-menu-item index="/home/special">专题</el-menu-item>
<el-menu-item index="/home/eBook">电子书</el-menu-item>
<el-menu-item index="/home/personalAll/personalSend">个人中心</el-menu-item>
</el-menu>
转载于:https://www.cnblogs.com/manong-xxf/p/11232676.html