vue-router中的 addRoutes 方法
作用:动态添加路由配置
注意:addRoutes的参数一定是一个数组
格式:
router.addRoutes([路由配置对象])或者:this.$router.addRoutes([路由配置对象])
代码示例:
//按钮<button @click="hAddRoute">addRoutes</button>//回调hAddRoute(){this.$router.addRoutes([{path:'/abc',component:() => import('@/views/abc')}])}
