--- order: 5 title: 表单组合 --- 集中营,展示和表单相关的其他 ant-design 组件。 ````jsx import { Form, Select, InputNumber, DatePicker, TimePicker, Switch, Radio, Cascader, Slider, Button, Col, Upload, Icon } from 'antd'; const FormItem = Form.Item; const Option = Select.Option; const RadioButton = Radio.Button; const RadioGroup = Radio.Group; const areaData = [{ value: 'shanghai', label: '上海', children: [{ value: 'shanghaishi', label: '上海市', children: [{ value: 'pudongxinqu', label: '浦东新区', }], }], }]; let Demo = React.createClass({ handleSubmit(e) { e.preventDefault(); console.log('收到表单值:', this.props.form.getFieldsValue()); }, normFile(e) { if (Array.isArray(e)) { return e; } return e && e.fileList; }, render() { const { getFieldProps } = this.props.form; return (
); }, }); Demo = Form.create()(Demo); ReactDOM.render(