Commit 18cbf254 authored by 张俊's avatar 张俊

route容错

parent 8d339879
...@@ -89,10 +89,12 @@ router.beforeEach((to, from, next) => { ...@@ -89,10 +89,12 @@ router.beforeEach((to, from, next) => {
// }) // })
function addRoute(router,routers){ function addRoute(router,routers){
routers.forEach(e => { routers.forEach(e => {
if(e.path[0]=='/'){
router.addRoute(e) router.addRoute(e)
if(e.children&&e.children.length){ if(e.children&&e.children.length){
addRoute(router,e.children) addRoute(router,e.children)
} }
}
}); });
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment