<el-select v-if="model" filterable class="w" v-model="ruleForm.allModelId" placeholder="请选择" @change="changeModel($event)" > <el-option v-for="item in model" :key="item.id" :label="item.modelName" :value="item.id" ></el-option> </el-select>
changeModel(id) { let obj = {}; obj = this.model.find((item) => { //model就是上面的数据源 return item.id === id; //筛选出匹配数据 }); console.log(obj); this.ruleForm.allModelName = obj.modelName; this.ruleForm.allModelId = obj.id; },
标签:el,obj,ruleForm,select,id,change From: https://www.cnblogs.com/dianzan/p/16802971.html