# 表单组合 - order: 5 集中营,展示和表单相关的其他 ant-design 组件。 --- ````jsx import { Form, Select, InputNumber, DatePicker, Switch, Radio, Slider, Button, message, Row, Col, Upload, Icon } from 'antd'; const FormItem = Form.Item; const Option = Select.Option; const RadioButton = Radio.Button; const RadioGroup = Radio.Group; const Demo = React.createClass({ mixins: [Form.ValueMixin], getInitialState() { return { formData: { inputNumber: undefined, static: '唧唧复唧唧木兰当户织呀', switch: undefined, slider: undefined, select: undefined, startDate: undefined, endDate: undefined, } }; }, handleUpload(info) { if (info.file.status !== 'uploading') { console.log(info.file, info.fileList); } if (info.file.status === 'done') { message.success(info.file.name + ' 上传成功。'); } else if (info.file.status === 'error') { message.error(info.file.name + ' 上传失败。'); } }, handleSubmit(e) { e.preventDefault(); message.success('收到表单值~~~ :' + JSON.stringify(this.state.formData, function(k, v) { if (typeof v === 'undefined') { return ''; } return v; })); }, render() { const formData = this.state.formData; return (
); } }); ReactDOM.render(