el-select 根据value查询其对应的label值

<el-form-item label="库位" prop="goodsLocationId" >

  <el-col :span="15">

    <el-select v-model="scope.row.goodsLocationId" placeholder="货位地址" @change="changeLocationValue">

      <el-option v-for="lo in locations" :label="lo.locationName" :value="lo.id" :key="lo.id"></el-option>

    </el-select>

  </el-col>

</el-form-item

 changeLocationValue(val){

  let obj = {};

  obj = this.locations.find((item)=>{

    return item.id === val;

  });

  this.goodsLocationId.goodsLocationName = obj.locationName;

}, 

posted on 2018-09-28 15:22  紫藤萝yu  阅读(6205)  评论(0编辑  收藏  举报