vue动态添加路由

146 阅读1分钟

先创建最基本的子路由

image.png

在mock接口数据里面添加二级路由:

image.png

根据具体的逻辑去动态的添加路由菜单:

image.png

一进入页面就默认激活/index/user导航菜单怎么解决?

image.png