elementUI的导航栏怎么根据路由默认选中相关项

1. 

<el-menu :default-active="this.$route.path.substr(1)" class="left-nav">

2. 

el-submenu或者el-menu-item的index设置成路由对应的字符串
 
 
比如:路由为http://localhost:8080/#/project/list时,将需要被选中的el-submenu或者el-menu-item的index设置为 index="project/list"
文章来自:http://www.cnblogs.com/XHappyness/p/7682944.html
© 2021 jiaocheng.bubufx.com  联系我们
ICP备案:鲁ICP备09046678号-3