三级菜单自动配置组件
This commit is contained in:
		| @@ -1,3 +1,3 @@ | ||||
| <template > | ||||
|   <router-view /> | ||||
| </template> | ||||
| <template > | ||||
|   <router-view /> | ||||
| </template> | ||||
| @@ -5,6 +5,7 @@ Vue.use(Router) | ||||
|  | ||||
| /* Layout */ | ||||
| import Layout from '@/layout' | ||||
| import ParentView from '@/components/ParentView'; | ||||
|  | ||||
| /** | ||||
|  * Note: 路由配置项 | ||||
|   | ||||
| @@ -1,6 +1,7 @@ | ||||
| import { constantRoutes } from '@/router' | ||||
| import { getRouters } from '@/api/menu' | ||||
| import Layout from '@/layout/index' | ||||
| import ParentView from '@/components/ParentView'; | ||||
|  | ||||
| const permission = { | ||||
|   state: { | ||||
| @@ -33,9 +34,11 @@ const permission = { | ||||
| function filterAsyncRouter(asyncRouterMap) { | ||||
|   return asyncRouterMap.filter(route => { | ||||
|     if (route.component) { | ||||
|       // Layout组件特殊处理 | ||||
|       // Layout ParentView 组件特殊处理 | ||||
|       if (route.component === 'Layout') { | ||||
|         route.component = Layout | ||||
|       } else if (route.component === 'ParentView') { | ||||
|         route.component = ParentView | ||||
|       } else { | ||||
|         route.component = loadView(route.component) | ||||
|       } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user