Skip to content

表单组件设置值时,遇到null时报错 #153

Closed
@904534675

Description

@904534675
  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

1.0.3

Environment

1.0.3

Reproduction link

Edit on CodeSandbox

Steps to reproduce

后台返回的数据在form中没有对应的item的情况,如下:
formdata:{'name':'zhangsan','age':17,'guid':null}
(后台返回的数据比较多,有些项目不需要展示出来)
这时表单中没有GUID这一项,用这个数据调用 setFieldsValue 时报错
错误信息: Cannot convert undefined or null to object"

What is expected?

麻烦处理一下null值,按空值处理

What is actually happening?

报错,form不能正常显示出来数据

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions