1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
| import Vue from "vue"; import Router from "vue-router";
Vue.use(Router);
import Layout from "@/views/layout/Layout";
export const constantRouterMap = [ { path: "/login", name: "login", component: () => import("@/views/login/login") }, { path: "/404", component: () => import("@/views/errorPage/404") }, { path: "", redirect: "/login" } ];
export const asyncRouterMap = [ { path: "/home", component: Layout, redirect: "/home/index", hidden: false, meta: { title: "首页", icon: "home", roles: [1] }, children: [ { path: "index", component: () => import("@/views/home/index"), name: "home", hidden: false, meta: { title: "首页", icon: "home", noCache: true, roles: ["admin"] } } ] }, { path: "*", redirect: "/404", hidden: true } ];
export default new Router({ mode: "hash", routes: constantRouterMap });
|