修改或添加路由参数
原url为:http://localhost/home
this.$router.push({
query:merge(this.$route.query,{
aaa:54
})
})
添加后url为: http://localhost/home?aaa=54
删除路由参数
原url为:http://localhost/home?aaa=54
let newQuery = JSON.parse(JSON.stringify(this.$route.query))
delete newQuery.aaa
this.$router.replace({query:this.$route.query})
添加后url为: http://localhost/home