| | |
| | | var children = [] |
| | | childrenMap.forEach((el, index) => { |
| | | if (el.children && el.children.length) { |
| | | if (el.component === 'ParentView') { |
| | | if (el.component === 'ParentView' && !lastRouter) { |
| | | el.children.forEach(c => { |
| | | c.path = el.path + '/' + c.path |
| | | if (c.children && c.children.length) { |
| | |
| | | return children |
| | | } |
| | | |
| | | export const loadView = (view) => { // 路由懒加载 |
| | | export const loadView = (view) => { |
| | | if (process.env.NODE_ENV === 'development') { |
| | | return (resolve) => require([`@/views/${view}`], resolve) |
| | | } else { |
| | | // 使用 import 实现生产环境的路由懒加载 |
| | | return () => import(`@/views/${view}`) |
| | | } |
| | | } |
| | | |
| | | export default permission |