vue 使用 this.$router.push() 传参

1 使用name 和 params

this.$router.push({name: 'Journalh', params: {id: obj.id}})
 // 获取参数
 this.$route.params.id

2 使用path 和 query传参

this.$router.push({path: 'Journalh', query: {id: obj.id}})
// 获取参数
 this.$route.query.id
发布了70 篇原创文章 · 获赞 67 · 访问量 4万+

猜你喜欢

转载自blog.csdn.net/qq_37896578/article/details/95645195