欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

vue路由嵌套重定向

程序员文章站 2022-03-24 19:59:16
...
import App from '../App.vue'

//子路由
import pcRoot from '../views/Pc/pcRoot.vue'
import moveRoot from '../views/Move/moveRoot.vue'

//父路由
import Pc from './pc.js'
import Move from './move'


export default [
    {
      path:'/',
      name: "app",
      component: App,
      redirect:"/home",    //重定向在子级中寻找/home
      children:[
          {
            path:'/home',
            redirect:"/page",    //在子级中寻找/page
            component: pcRoot,    //视图页面
            children: Pc
          },
          {
            path:'/move',
            redirect:"/move/page",
            component: moveRoot,
            children: Move
          },

      ]
    },
]