今儿遇到这种错,记录一下
出错主要原因有两种:调用setFieldsValue()传入表单的值与表单不对应/调用setFieldsValue()需要在需要放在$nextTick()函数中执行
先看第一种,有多少传多少
this.form.setFieldsValue({ demo: '1' })
第二种,放在$nextTick()中执行
this.$nextTick(()=>{
this.form.setFieldsValue({demo:'1'})
})
今儿遇到这种错,记录一下
出错主要原因有两种:调用setFieldsValue()传入表单的值与表单不对应/调用setFieldsValue()需要在需要放在$nextTick()函数中执行
先看第一种,有多少传多少
this.form.setFieldsValue({ demo: '1' })
第二种,放在$nextTick()中执行
this.$nextTick(()=>{
this.form.setFieldsValue({demo:'1'})
})