嵌套路由


在routes中加个属性children,要嵌套的地址就写进children中

编写关于用户的视图

用户列表






用户信息






在router中注册路由

{
      path: "/main",
      component: Main,
      children: [{
        path: "/user/userList",
        component: userList
      },
        {
          path: '/user/userProfile',
          component: userProfile
        }
      ]
    }

我想在main页面嵌入用户列表,所以在main中嵌入

main页面





插入的位置

显示的位置

界面效果