<el-form ref="form" :key="formKey" :model="formData" class="cncform" :rules="rules" label-width="140px">
<el-form-item label="供应商和制造片区" prop="supplier">
<el-select v-model="formData.supplier" placeholder="请选择供应商" style="width: 100%" @change="supplierChange">
<el-option v-for="item in supplierOptions" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
</el-form>
<script>
export default {
data() {
return {
formData:{
supplier:""
}
},
watch: {
'formData.supplier': {
handler(newVal) {
//再这里就可以监听到
console.log(newVal,'newVal')
},
deep: true
},
}
},
}
</script>
监听对象中某个属性值的变化
最新推荐文章于 2024-08-23 13:45:37 发布