【前端】VUE动态修改路由的params和query参数

修改params

this.$router.push({
       params: {...this.$route.params, name:this.name}  
 })


 

修改query

this.$router.push({
     query: {...this.$route.query, name:this.name} 
 })


 

同时修改

this.$router.push({
       params: {...this.$route.params, name: '李白'} 
     query: {...this.$route.query, name: '李白'} 
 })