2017-09-20

 

ant design 自定义表单验证大全

<FormItem {...formItemLayout}
                              label="主机名"
                              hasFeedback>
                      {getFieldDecorator('hostName', {
                        rules: [{
                          required: true, max: 20, message: '请输入主机名(最多20字符)!'
                        }],
                        initialValue: this.isAdd() ? "" : this.hostState.hosts.hostName
                      })(
                        <Input/>
                      )}
                    </FormItem>
View Code

相关文章: