提交 353601ca 编写于 作者: B Benjy Cui

docs: add demo for valuePropName #1062

上级 06591077
......@@ -7,13 +7,21 @@
---
````jsx
import { Select, Radio, Button, DatePicker, InputNumber, Form, Cascader } from 'antd';
import { Select, Radio, Checkbox, Button, DatePicker, InputNumber, Form, Cascader } from 'antd';
const Option = Select.Option;
const RadioGroup = Radio.Group;
const createForm = Form.create;
const FormItem = Form.Item;
let Demo = React.createClass({
componentDidMount() {
this.props.form.setFieldsValue({
eat: true,
sleep: true,
beat: true,
});
},
handleReset(e) {
e.preventDefault();
this.props.form.resetFields();
......@@ -113,6 +121,22 @@ let Demo = React.createClass({
</RadioGroup>
</FormItem>
<FormItem
label="兴趣爱好:"
labelCol={{ span: 7 }}
wrapperCol={{ span: 12 }}
help="Checkbox 必须设置 `valuePropName`">
<Checkbox {...getFieldProps('eat', {
valuePropName: 'checked',
})} />吃饭饭 &nbsp;
<Checkbox {...getFieldProps('sleep', {
valuePropName: 'checked',
})} />睡觉觉 &nbsp;
<Checkbox {...getFieldProps('beat', {
valuePropName: 'checked',
})} />打豆豆 &nbsp;
</FormItem>
<FormItem
label="生日:"
labelCol={{ span: 7 }}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册