Skip to content

Commit 9016631

Browse files
author
bearyan
committed
有reg的情况下也能返回empty错误
1 parent e458cc1 commit 9016631

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/form/form.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ function _validate($input, $form, regexp){
5959

6060
reg = regexp[reg];
6161
}
62-
return new RegExp(reg).test(val) ? null : 'notMatch';
62+
return new RegExp(reg).test(val) ? null : !$input.val().length ? 'empty' : 'notMatch';
6363
}else if(!$input.val().length){
6464
return 'empty';
6565
}else{

0 commit comments

Comments
 (0)