Closed lcygithub closed 8 years ago
empty string should be raised when rules include required,in utils.js ,function required should be
required
if (!this.isRoot() && this.rule.required && (!this.source.hasOwnProperty(this.field) || this.value === undefined || this.value === null || this.value === ""))
notice the this.value === ""
this.value === ""
Not so by design, the required field tests whether an expected property is specified. For strings that you do not want to be empty (or consist solely of whitespace) use the whitespace property.
whitespace
See: https://github.com/tmpfs/async-validate/blob/6fb83e05400d9a112e5164ae73ca02829ff516b1/plugin/string.js#L22-L29
empty string should be raised when rules include
required
,in utils.js ,function required should beif (!this.isRoot() && this.rule.required && (!this.source.hasOwnProperty(this.field) || this.value === undefined || this.value === null || this.value === ""))
notice the
this.value === ""