docs: Update form demo (#22483)

This commit is contained in:
二货机器人 2020-03-22 11:48:56 +08:00 committed by GitHub
parent 4e270e1873
commit d33784b813
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -247,7 +247,14 @@ const RegistrationForm = () => {
</Row>
</Form.Item>
<Form.Item name="agreement" valuePropName="checked" {...tailFormItemLayout}>
<Form.Item
name="agreement"
valuePropName="checked"
rules={[
{ validator:(_, value) => value ? Promise.resolve() : Promise.reject('Should accept agreement') },
]}
{...tailFormItemLayout}
>
<Checkbox>
I have read the <a href="">agreement</a>
</Checkbox>