vue 查詢參數修改但頁面沒渲染,值已改變


詳情頁面   路由上帶了參數並賦值展示成功,

這個由路由上帶的參數修改時,頁面沒渲染,值已改變,

如果此時去做別的不是路由賦值的參數修改,前面做的修改就刷新出來渲染成功

原代碼

 this.crud.query.bankId ="";
 this.crud.query.batchNo ="";
    this.$nextTick(() => {
      this.crud.data = [];
      if (this.$route.query.bankId) {
           //  this.crud.query.bankId = this.$route.query.bankId + "";
    this.$set(this.query, "bankId", this.$route.query.bankId + "");
      }
      if (this.$route.query.batchNo) {
        //     this.crud.query.batchNo = this.$route.query.batchNo;
  this.$set(this.query, "batchNo", this.$route.query.batchNo);    
  }
      this.crud.toQuery();
    });

經過長久測試

發現這樣就可以了emmmm

    this.$set(this.crud.query, "bankId", "");
    this.$set(this.crud.query, "batchNo", "");
    this.$nextTick(() => {
      this.crud.data = [];
      if (this.$route.query.bankId) {
        this.crud.query.bankId = this.$route.query.bankId + "";
        // this.$set(this.query, "bankId", this.$route.query.bankId + "");
      }
      if (this.$route.query.batchNo) {
        this.crud.query.batchNo = this.$route.query.batchNo;
      }
      this.crud.toQuery();
    });

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM