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

当getFieldProps和checkbox结合使用时,initialValue无法生效 #2225

Closed
taikongfeizhu opened this issue Jun 30, 2016 · 3 comments
Closed

Comments

@taikongfeizhu
Copy link

本地环境

  • antd 版本: 1.3.2
  • 操作系统及其版本:mac
  • 浏览器及其版本: chrome50

你做了什么?

引入 antd 了 Form, Input, Checkbox

你期待的结果是:

通过getFieldProps可以给checkbox正常做initialValue赋值

实际上的结果:

<Checkbox
      {...getFieldProps('firstSocialSecurity', {
                initialValue: true
    })}>第一次在北京缴纳社保
</Checkbox>

当getFieldProps和checkbox结合使用时,initialValue无法生效;

@benjycui
Copy link
Contributor

http://ant.design/components/form#getFieldProps options

image

Please read documentation & FAQ and search issues before open an issue, THX!

It will be better if you read smart questions(提问的智慧).

@Rosa0418
Copy link

<Checkbox
{...getFieldProps('firstSocialSecurity', {
valuePropName: 'checked',
initialValue: true
})}>第一次在北京缴纳社保

@lock
Copy link

lock bot commented May 3, 2018

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.

@lock lock bot locked as resolved and limited conversation to collaborators May 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants