更改当前路由的传参刷新页面

 // 上一页
    upPople() {
      let _this = this;
      let applyCode = this.$route.query.applyCode;
      let paramList = sessionStorage.getItem("paramList");
      let arrList = JSON.parse(paramList);
      for (let i = 0; i < arrList.length; i++) {
        if (applyCode == arrList[i].applyCode) {
          this.popleList = arrList[i - 1];
          let query = Object.assign({applyCode:arrList[i - 1].applyCode,candidateCode:arrList[i - 1].candidateCode}, {} )
          this.$router.push({ query})
        }
      }
    },
    // 下一页
    dwonPople(){
      let _this = this;
      let applyCode = this.$route.query.applyCode;
      let paramList = sessionStorage.getItem("paramList");
      let arrList = JSON.parse(paramList);
      for (let i = 0; i < arrList.length; i++) {
        if (applyCode == arrList[i].applyCode) {
          this.popleList = arrList[i + 1];
          let query = Object.assign({applyCode:arrList[i + 1].applyCode,candidateCode:arrList[i + 1].candidateCode}, {} )
          this.$router.push({ query})
        }
      }
    },







 watch:{
      '$route' (to, from) { //监听路由是否变化
        if(to.query.applyCode!= from.query.applyCode){
          this.getPowerAlllist();
          this.getChangepople();
          this.getAtsgetServer();
          this.getinfo();
          this.getinfourl();
          this.getListResumeAtthachmentsRes();
          this.getList();
          this.getnote();
          this.getselectTalentInfo();
          this.getselectWritten();
          this.getAtsSelectInterview();
        }
      }
  },

 let query = Object.assign({applyCode:arrList[i - 1].applyCode,candidateCode:arrList[i - 1].candidateCode}, {} )
          this.$router.push({ query})
watch:{
      '$route' (to, from) { //监听路由是否变化
        if(to.query.applyCode!= from.query.applyCode){
          
        }
      }
  },


你可能感兴趣的:(vue-element)