vue 修改当前页面传入的query参数

需求:

  需要在详情页面修改当前页面query传过来的参数。

代码:

const query=JSON.parse(JSON.stringify(this.$route.query))
query.state=true;//state 修改的参数
this.$router.push({ path: this.$route.path, query })
原文地址:https://www.cnblogs.com/houBlogs/p/14975749.html