嵌套路由中实现动态路由地址,点击一个按钮跳转到同一个路由组件,但是根据ID出现不同的数据,路由地址的后缀类似变量的ID

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/pansuyong/article/details/82056186
{
  path: '/singer',
  component: Singer,
  children: [
    {
      path: ':id',
      component: SingerDetail
    }
  ]
},
selectSinger(singer){
this.$router.push({
  path:`/singer/${singer.id}`
})
},

猜你喜欢

转载自blog.csdn.net/pansuyong/article/details/82056186