问题描述

You cannot set a form field before rendering a field associated with the value. You can use getFieldDecorator(id, options) instead v-decorator="[id, options]" to register it before render.

jeecg-boot /antd 解决You cannot set a form field before rendering a field associated with the value问题

出现场景

在用ant-design-vue的框架中,使用到了这种场景,就是点击编辑按钮,弹出modal模态框,渲染modal模态框中的form表单页面,并给表单赋值,但是在给表单赋值的时候,总是会报错

出现原因

使用了表单的方法setFieldsValue(),来设置一组输入控件的值,传入的值为object,但是传入的值要和表单的值一一对应,能少传不能多传

解决方法

删掉没有用到的值
jeecg-boot /antd 解决You cannot set a form field before rendering a field associated with the value问题
这里也要删一下

jeecg-boot /antd 解决You cannot set a form field before rendering a field associated with the value问题

相关文章:

  • 2021-10-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-06
  • 2021-11-18
  • 2021-05-03
  • 2021-08-08
猜你喜欢
  • 2021-07-25
  • 2021-05-30
  • 2021-11-27
  • 2021-07-25
  • 2021-07-29
  • 2022-12-23
相关资源
相似解决方案