parent
ba933acf76
commit
cc375077da
7 changed files with 34 additions and 62 deletions
@ -1,26 +0,0 @@ |
||||
import store from "@/store"; |
||||
import router from "@/router"; |
||||
|
||||
export default function() { |
||||
setTimeout(() => { |
||||
let routes = store.state.auth.routes; |
||||
routes.forEach(e => { |
||||
if (e.path == "/") { |
||||
e.component = () => import("@/layouts/home/index.vue"); |
||||
} else { |
||||
e.component = () => import(`@/pages/${e.path}.vue`); |
||||
} |
||||
|
||||
e.children && e.children.forEach(n => { |
||||
n.path && (n.component = () => import(`@/pages/${n.path}.vue`)); |
||||
}); |
||||
}); |
||||
|
||||
routes.push({ |
||||
path: "*", |
||||
redirect: "404" |
||||
}); |
||||
|
||||
router.addRoutes(routes); |
||||
}, 500); |
||||
} |
Loading…
Reference in new issue