diff --git a/src/views/roadwayManage/model.vue b/src/views/roadwayManage/model.vue index 4fa21f6..881bc9b 100644 --- a/src/views/roadwayManage/model.vue +++ b/src/views/roadwayManage/model.vue @@ -193,13 +193,14 @@ export default { this.title = newVal; }, modelData: function(newVal){ + // console.log(newVal) if(newVal.id){ this.mdata=newVal this.leftType=newVal.leftType this.rightType=newVal.rightType - console.log('更新了') - this.$nextTick(()=>{ - this.form.setFieldsValue({ //setFieldsValue 表示对form表单重新设置值 + // console.log('触发了watch,重新赋值') + this.$nextTick(()=>{ //this.$nextTick解决不能在表单渲染之前赋值的报错问题 + this.form.setFieldsValue({ //setFieldsValue 表示对form表单重新设置值 name:newVal.name, plcId:newVal.plcId, leftType:newVal.leftType === null ? '' : newVal.leftType === 0 ? '单伸' : '双伸',