this.$router.push({
name:'/detail',
query:{
id:123
}
})
import merge from 'webpack-merge';
//修改原有参数
this.$router.push({
query:merge(this.$route.query,{'id':1})
})
//新增一个参数:
this.$router.push({
query:merge(this.$route.query,{'addtype':'add'})
})
//替换所有参数:
this.$router.push({
query:merge({},{'type':'all'})
})
会导致
this.$router.back() //失效
通过这样跳转
this.$router.push({
name:'/page',
})