--- order: 14 title: zh-CN: 校验其他组件 en-US: Other Form Controls --- ## zh-CN 以上演示没有出现的表单控件对应的校验演示。 ## en-US Demostration for validataion configuration for form controls which are not show in the above demos. ````jsx import { Form, Select, InputNumber, Switch, Radio, Slider, Button, Upload, Icon, Rate, } from 'antd'; const FormItem = Form.Item; const Option = Select.Option; const RadioButton = Radio.Button; const RadioGroup = Radio.Group; class Demo extends React.Component { handleSubmit = (e) => { e.preventDefault(); this.props.form.validateFields((err, values) => { if (!err) { console.log('Received values of form: ', values); } }); } normFile = (e) => { console.log('Upload event:', e); if (Array.isArray(e)) { return e; } return e && e.fileList; } render() { const { getFieldDecorator } = this.props.form; const formItemLayout = { labelCol: { span: 6 }, wrapperCol: { span: 14 }, }; return (
); } } const WrappedDemo = Form.create()(Demo); ReactDOM.render(