Ant-design: 当getFieldProps和checkbox结合使用时,initialValue无法生效

Created on 30 Jun 2016  ·  3Comments  ·  Source: ant-design/ant-design

本地环境

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

    你做了什么?

引入 antd 了 Form, Input, Checkbox

你期待的结果是:

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

实际上的结果:

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

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

Most helpful comment

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

All 3 comments

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(提问的智慧).

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

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ryannealmes picture ryannealmes  ·  3Comments

PeteAndersen picture PeteAndersen  ·  3Comments

drcmda picture drcmda  ·  3Comments

zhangchen2397 picture zhangchen2397  ·  3Comments

ericdai picture ericdai  ·  3Comments