vue router 常用操作 重定向 redirect
生活随笔
收集整理的這篇文章主要介紹了
vue router 常用操作 重定向 redirect
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
1、重定向 redirect
const routes = [{ path: '/', redirect: '/index'},{ path: '/index', component: index } ]2、嵌套路由
const routes = [{ path: '/index', component: index,children: [{ path: 'info', component: info}]} ]通過/index/info就可以訪問到info組件了
3、懶加載
const routes = [{ path: '/index', component: () => import('@/views/index.vue')},{ path: '/hello', component: () => import('@/views/hello.vue') } ]總結
以上是生活随笔為你收集整理的vue router 常用操作 重定向 redirect的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: DWS自动化包裹称重扫码测体积快手台的开
- 下一篇: mpvue 微信小程序 显示 转发按钮