更多方式请见:https://mp.weixin.qq.com/s/-mSBuGcjmSMT5C7KaLgftQ

 

如果提供了 pathparams 会被忽略:

// 带有路径的对象
   this.$router.push({path: '/details/001'})
// 命名路由,路由配置时,需要 name 字段
   this.$router.push({ name: 'details', params: { id: '001' } })

使用 query 时,以下三种方式都是可行的:

this.$router.push('/details/001?kind=car')
this.$router.push({ path: '/details/001', query: { kind: "car" }})
this.$router.push({ name: 'details', params: { id: '001' }, query: { kind: 'car' }})

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-04
  • 2022-12-23
  • 2021-11-28
  • 2021-11-11
  • 2022-12-23
  • 2021-04-12
相关资源
相似解决方案