# 表单组合 - 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(); console.log('收到表单值:', this.state.formData); }, render() { const formData = this.state.formData; return (
); } }); ReactDOM.render(