演示代码:
const { Form, Select, InputNumber, DatePicker, TimePicker, Switch, Radio,
Cascader, Slider, Button, Col, Upload, Icon } = 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 (
key = '1'
wrapperCol = {{span:'5'}}>
placeholder='请选择类型'
{...getFieldProps('super_category_id',)}>
111
key = '2'
wrapperCol = {{span:'5'}}>
placeholder='请选择类型'
{...getFieldProps('super_category_id',)}>
111
);
},
});
Demo = Form.create()(Demo);
ReactDOM.render(, document.getElementById('container'));