Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setFieldsValue 和setFieldValue 表现不一致 #733

Open
zoro-r opened this issue Nov 6, 2024 · 1 comment
Open

setFieldsValue 和setFieldValue 表现不一致 #733

zoro-r opened this issue Nov 6, 2024 · 1 comment

Comments

@zoro-r
Copy link

zoro-r commented Nov 6, 2024

如果组件有初始值:

initialValues = {
test: {
   op: {
          name: 1,
          code: 2,
        },
}

执行
setFieldsValue({
         op: {
             name: 33,
          },
    })

得到的结果为
test: {
   op: {
          name: 1,
          code: 33,
        },
}

执行
setFieldValue('op', {
             name: 33,
    })

得到的结果为

test: {
   op: {
          code: 33,
        },
}
@zoro-r
Copy link
Author

zoro-r commented Nov 6, 2024

setFieldsValue 会把对象进行合并

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant