{
label: '单位',
type: 'select',
dicUrl: '/hztech-itai/unit/list-option',
props: {
label: 'label',
value: 'value',
},
dataType: 'string',
slot: true,
prop: 'unitId',
search: true,
searchSpan:4,
width:200,
overHidden: true,
filterable:true,
allowCreate: true,
change(val,val2){
console.log(val,val2);
console.log(this.form);
console.log(this.$refs.form);
// this.form.unitId = "";
// this.form.unitLabel = val.value
},
rules: [
{
required: true,
message: '请选择单位',
trigger: 'blur',
},
],
},
用watch监听 unitId ,如果有变动,就在watch代码块去修改 this.form的值。
参考:https://center.javablade.com/blade/Saber3/src/branch/master/src/views/authority/datascope.vue#L433
扫一扫访问 Blade技术社区 移动端