isRequired 空数组也不能通过

This commit is contained in:
liaoxuezhi 2019-09-04 15:54:44 +08:00
parent 84cafd0755
commit bab2f59ba2

View File

@ -21,7 +21,7 @@ export const validations:{
[propsName:string]: ValidateFn
} = {
isRequired: function (values, value:any) {
return value !== undefined && value !== '' && value !== null;
return value !== undefined && value !== '' && value !== null && (!Array.isArray(value) || !!value.length);
},
isExisty: function (values, value) {
return isExisty(value);