1.  普通路由

const routes = [
    { path: '/index', component: index }
]

2. 重定向 redirect

const routes = [
    { path: '/', redirect: '/index'},
    { path: '/index', component: index }
]

3. 嵌套路由

const routes = [
    { path: '/index', component: index,
        children: [
            { path: 'info', component: info}
        ]
     }
]

4. 懒加载

const routes = [
    { path: '/index', component: () => import('@/views/index.vue')},
    { path: '/hello', component: () => import('@/views/hello.vue') }
]

 

相关文章:

  • 2021-05-24
  • 2021-08-04
  • 2021-05-21
  • 2022-12-23
  • 2022-12-23
  • 2021-08-07
猜你喜欢
  • 2021-12-29
  • 2021-06-06
  • 2022-01-11
  • 2021-09-22
  • 2021-09-20
  • 2022-12-23
相关资源
相似解决方案