import Button from '../../button'; import Field from '../../field'; import Form from '..'; import Input from '../../input'; import Radio from '../../radio'; import React from 'react'; import ReactDOM from 'react-dom'; const FormItem = Form.Item; const RadioGroup = Radio.Group; const formItemLayout = { labelCol: { span: 6, }, wrapperCol: { span: 14, }, }; class BasicDemo extends React.Component { field: Field; validate: () => void; constructor(props) { super(props); this.field = new Field(this); this.validate = () => { this.field.validate([ 'sex' ]); }; } userExists(rule, value) { return new Promise((resolve, reject) => { if (!value) { resolve(undefined); } else { setTimeout(() => { if (value === 'frank') { reject(new Error('Sorry, this username is already occupied.')); } else { resolve(undefined); } }, 500); } }); } checkPass(rule, value, callback) { const { validate } = this.field; if (value) { validate([ 'rePasswd' ]); } callback(); } checkPass2(rule, value, callback) { const { getValue } = this.field; if (value && value !== getValue('passwd')) { return callback('Inconsistent password input twice!'); } return callback(); } render() { const { getState, getValue, getError } = this.field; return (

Hello {getValue('username')}

Male Female console.log(v, e)} style={{ margin: '0 10px' }} > Submit Reset
); } } ReactDOM.render(, document.getElementById('form-demo-12'));