在reactjs中我使用ant设计表单。在这种形式中,我不希望使用 getfielddecorator 进行默认验证。我想用我自己的验证来验证字段。它如何验证? 例如
<Form onSubmit={this.handlesubmit.bind(this)}> <FormItem>
<input/>
</FormItem>
<FormItem >
<input/>
</FormItem>
<ButtonAnt className="btng" type="primary" htmlType="submit">Save</ButtonAnt>
</Form>
最佳答案
根据docs ,
We provide properties like
validateStatus
help
hasFeedback
to customize your own validate status and message, without usingForm.create
andgetFieldDecorator
.
此外,似乎还有一个 validator
属性 ( amongst others ),您可以使用它来编写自己的验证器函数。
关于reactjs - 如何在reactjs中不使用getFieldDecorator的情况下验证ant design formitems?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47668931/