我在工作中发现,路由本身有query参数,但是我点击更新了query,也push了,页面url不改变,这个时候其实用到了对象的拷贝,你需要对query对象做拷贝,对象的拷贝方法如https://blog.csdn.net/lbPro0412/article/details/81258995
代码如下,我才用的对象变字符串再变对象拷贝方法
let query = this.$router.history.current.query;
let path = this.$router.history.current.path;
//对象的拷贝
let newQuery = JSON.parse(JSON.stringify(query));
newQuery.pid = pid;
this.$router.push({ path, query: newQuery });
如有更好的方法,欢迎分享。。。