美文网首页
vue-router 父子路由嵌套

vue-router 父子路由嵌套

作者: 无名程序猿 | 来源:发表于2022-03-18 08:08 被阅读0次

    路由配置

    import home from '@/pages/home'
    import detail from '@/pages/detail'
    {
      name:'home',
      path:'/home',
      component:home,
      children:[{
        name:'detail',
        path:'/home/detail',
        component:detail
      }]
    }
    

    html用法

    // 左侧菜单
    <router-link>home</router-link>
    
    // 右侧内容
    <router-view></router-view>
    

    相关文章

      网友评论

          本文标题:vue-router 父子路由嵌套

          本文链接:https://www.haomeiwen.com/subject/sfxvdrtx.html