路由本身有query参数,更新了query,也push了,页面url不改变,这个时候其实用到了对象的拷贝,你需要对query对象做拷贝
let query = this.$router.history.current.query;
let path = this.$router.history.current.path;
//对象的拷贝
let newQuery = JSON.parse(JSON.stringify(query));
newQuery.id= id;
this.$router.push({ path, query: newQuery });
1777



被折叠的 条评论
为什么被折叠?



