鍍金池/ 問答/HTML5  PHP  數(shù)據(jù)庫  HTML/ react ant design mobile中自帶驗證不能驗證空格嗎

react ant design mobile中自帶驗證不能驗證空格嗎

{...getFieldProps('key',{
                   rules: [
                          { required: true, message: '不能為空' },
                                 // { validator: this.validateKey },
                          ],
 })}

只輸入空格也通過了,如何解決啊

回答
編輯回答
兮顏

你好,請問rules里的validator可以和async-validator結(jié)合起來嗎?難道得一個的寫驗證器

2017年8月20日 17:14
編輯回答
葬憶
{...getFieldProps('key',{
                   rules: [
                          { required: true, message: '不能為空' },
                          { whitespace: true },
                          ],
 })}

多看文檔

2017年5月22日 10:03