Commit d983f8bc authored by 张俊's avatar 张俊

菜单资源路径调整

parent e61d5c0e
...@@ -284,21 +284,34 @@ var menuToRouter = (menu) => { ...@@ -284,21 +284,34 @@ var menuToRouter = (menu) => {
e.component = () => import("../page/parent/parent.vue"); e.component = () => import("../page/parent/parent.vue");
menuToRouter(e.children); menuToRouter(e.children);
} else if (e.children && e.menuType !== 0) { } else if (e.children && e.menuType !== 0) {
console.log(`@/page/main${e.path}/index.vue`);
//叶子层级需要加载到对应文件 //叶子层级需要加载到对应文件
//对首页做兼容 //对首页做兼容
if(e.source){
console.log(`@/page/main${e.source}/index.vue`);
e.component = getViews(e.source);
}else{
console.log(`@/page/main${e.path}/index.vue`);
e.component = getViews(e.path); e.component = getViews(e.path);
}
menuToRouter(e.children); menuToRouter(e.children);
} else { } else {
console.log(`@/page/main${e.path}/index.vue`); console.log(`@/page/main${e.path}/index.vue`);
//叶子层级需要加载到对应文件 //叶子层级需要加载到对应文件
//对首页做兼容 //对首页做兼容
if (e.path == "/") { if (e.path == "/") {
if(e.source){
e.component = () => import(`../page/main/${e.source}/index.vue`);
}else{
e.component = () => import("../page/main/index/index.vue"); e.component = () => import("../page/main/index/index.vue");
}
} else { } else {
if(e.source){
e.component = getViews(e.source);
}else{
e.component = getViews(e.path); e.component = getViews(e.path);
} }
} }
}
}); });
}; };
......
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