import merge from 'webpack-merge'; // 修改原有參數 this.$router.push({ query:merge(this.$route.query,{'maxPrice':'630'}) }) // 新增一個參數: this.$router.push({ query:merge(this.$route.query,{'addParams':'我是新增的一個參數,哈哈哈哈'}) }) // 替換所有參數: this.$router.push({ query:merge({},{'maxPrice':'630'}) })
如果是params傳參,只需要將query改為params即可
參考鏈接:https://blog.csdn.net/sllailcp/article/details/80312848