vue子路由小实例

#vue子路由小实例(如有错误或更好写法还请指正)
实现效果
vue子路由小实例_第1张图片
上代码





router.js 代码

{
      path: '/demo2',
      name: 'demo2',
      component: demo2,
      children: [
        {
          path: '/basicInfo',
          name: 'basicInfo',
          component: basicInfo,
        },
        {
          path: '/setPortrait',
          name: 'setPortrait',
          component: setPortrait,
          children: [
            {
              path: '/uploadImg',
              name: 'uploadImg',
              component: uploadImg,
            },
          ],
        },
        {
          path: '/securityCenter',
          name: 'securityCenter',
          component: securityCenter,
        },
      ],
    },

随后就可以在各个子路由页面写出相应的GUI东西啦

你可能感兴趣的:(web前端学习)