【问题标题】:VueJS - Go directly to children routeVueJS - 直接转到子路由
【发布时间】:2019-02-03 06:40:38
【问题描述】:

我用 vuejs 做了一个仪表板。 我的问题是我想直接转到“仪表板/我的个人资料”路线。 这条路线是另一条路线的子路线:

{
    path: '/dashboard', 
    name: 'dashboard',          
    components: { default:Dashboard },      
    children: [ 
            {
                path: 'my-profile', 
                name: 'show_profile', 
                components: {
                    subview: Profile
                }           
            }
        ]
}

当我尝试直接转到“仪表板/我的个人资料”时,它加载良好但立即重定向到“仪表板”他的父母 你知道我该怎么做吗?

【问题讨论】:

    标签: vue.js vuejs2


    【解决方案1】:

    您似乎还没有为Profile 定义路由器视图:

    <router-view></router-view><!-- Default: Dashboard -->
    <router-view name="subview"></router-view><!-- Profile -->
    

    【讨论】:

      猜你喜欢
      • 2023-04-09
      • 2018-04-22
      • 2021-11-27
      • 2018-01-13
      • 1970-01-01
      • 1970-01-01
      • 2021-08-17
      • 2017-07-13
      • 2018-10-05
      相关资源
      最近更新 更多