步骤:
1.模块一:路由数组1
2.模块二:路由数组2
3.将路由数组1和路由数组2,添加到框架路由对象
import Vue from 'vue' import Router from 'vue-router' Vue.use(Router) let myroutes = [] let concat = (router) => { myroutes = myroutes.concat(router) } import settingRouter from '../views/setting/router' import homeRouter from '../views/home/router' concat(settingRouter) concat(homeRouter) export default new Router({ routes: myroutes })