<el-form-item label="油卡价格:" prop="petrolPrice">
      <el-select v-model="priceForm.petrolPrice" placeholder="油卡价格">//监听priceForm对象里面的petrolPrice属性的变化 
        <el-option v-for="item in priceData"
                   :label="item.label"
                   :value="item.value"></el-option>
      </el-select>
 </el-form-item>
data(){
  return{
    priceForm: {
          petrolPrice: null,
          withdrawableDiscount: null,
          ordinaryDiscount: null,
          telephoneDiscount: null
     },
  }
}
watch: {
      "priceForm.petrolPrice": function(){ //加引号监听对象里的属性
        this.getPetrolPrice();
        this.setPriceDiscount();
      }
 },

 

Logo

前往低代码交流专区

更多推荐