vue根据后端菜单自动生成路由(动态路由) router.js import Vue from 'vue' import Router from 'vue-router' import store from '../store' import generateRouter from './generateRouter' import cookie from './cookie.js' Vue.use(Router) let router = new Router() const getRoute…
import constant from './const' export function getRouters (files) { let filenames = files.keys() let list = mapToList(filenames) let routerArr = getTree(list) return routerArr } function getTree (list) { let routers = [] list.map((obj, index) => { //…