1.在router/index.js 中
router.$addRoutes = (params) => {
router.matcher = new Router({mode: 'history'}).matcher
router.addRoutes(params)
}
2.在使用的地方
this.$router.$addRoutes(routes)
1.在router/index.js 中
router.$addRoutes = (params) => {
router.matcher = new Router({mode: 'history'}).matcher
router.addRoutes(params)
}
2.在使用的地方
this.$router.$addRoutes(routes)