方法如下:
1:params
this.$router.push({name: 'test', params: {html: this.html}})
this.$router.push({path: '/details', query: {data: data}})
**注意** 当使用path的时候,参数需要使用query来传,否则在目标页面无法接收到参数
其中name/path的值就是要跳转的目标路由,params的值是参数
在目标路由页面获取参数:
let params = this.$route.params.html
2:query
this.$router.push({name: 'test', query: {html: this.html}})
其中name的值就是要跳转的目标路由,query的值是参数
在目标路由页面获取参数:
let query = this.$route.query.html