不能直接将绑定的字段置空
//线路名称选框的change事件
changeLineName(val) {
//强制刷新
this.$forceUpdate();
if (val) {
this.getConductorInfo(val);
}
//删除第二个select绑定的属性
delete this.formInfo.conductorId;
//重新添加第二个select绑定的空的属性
this.$set(this.formInfo, "conductorId", "");
//延迟验证,否则第一个刚改,第二个清空后直接进行验证提示
this.$nextTick(() => {
this.$refs["formInfo"].clearValidate("conductorId");
});
},