Skip to content

支持的验证规则

规则名称类型说明
requiredBoolean必填项验证
numberBoolean数值验证
integerBoolean整数验证
floatBoolean浮点数验证
chnBoolean中文验证
chnNumBoolean同时包含数字和汉字
chnOrNumBoolean包含汉字或者数字
alphaLineBoolean英文和下划线,首尾不能是下划线、且不能只是下划线
landlineBoolean固定电话号验证
mobileBoolean手机号验证
alphaNumBoolean字母和数字
zipCodeBoolean邮政编码验证
emailBoolean电子邮箱验证
idCardBoolean身份证验证
regExpUTSRegExp自定义正则表达式验证
minNumber最小长度验证
maxNumber最大长度验证
lengthNumber[]长度范围验证,如 [6, 20]
notbetweenNumber[]不在范围之间,如 [6, 20]
inString[]数据在指定数组内
notInString[]数据不在指定数组内
gtNumber大于某值
egtNumber大于或等于某值
eltNumber小于或等于某值
ltNumber小于某值
eqNumber等于某值
notEqNumber不等于某值
validatorFunction自定义验证函数