为什么很多个路由记录信息的component:Layout
来源:11-1 创建电子书上传组件
 
			慕圣3435224
2020-10-23
{
    path: '/redirect',
    component: Layout,
    hidden: true,
    children: [
      {
        path: '/redirect/:path(.*)',
        component: () => import('@/views/redirect/index')
      }
    ]
  },
{
    path: '/',
    component: Layout,
    redirect: '/dashboard',
    children: [
      {
        path: 'dashboard',
        component: () => import('@/views/dashboard/index'),
        name: 'Dashboard',
        // affix:用于指定当前路由记录是否默认固定显示在 tagsView 上
        meta: { title: 'Dashboard', icon: 'dashboard', affix: true }
      }
    ]
  }
为什么前端中有很多路由配置信息中的component的值为Layout,什么样的路由记录需要这样写?
写回答
	1回答
- 
				  扬_灵 2020-10-23 同学你好,这个Layout是一个组件,是我们在配置路由时导入的,这个组件显示的内容是左侧菜单栏和头部的展示信息,写在顶级路由表示这是个通用组件每个路由都有这部分的内容,你可以单独写一个路由把Layout组件给展示出来看一下。 00
相似问题
