el-select選中后,值未更新的問題


 <el-select v-model="forms.district_id" size="mini"  placeholder=""  @change="userDistricts" class="diredge-addres">
  <el-option
      v-for="item in options2"
      :key="item.id"
      :label="item.name"
      :value="item.id">
  </el-option>
</el-select>


 userDistricts (e) {
      this.$forceUpdate()
    },

原因

數據層次太多,render函數沒有自動更新,需手動強制刷新(this.$forceUpdate)

方法

  1. 給select添加change事件,強制刷新。具體代碼


免責聲明!

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



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