Skip to content

验证规则 ​

用法 ​

required 校验必传 ​

参数说明类型默认值
tips提示string此项为必填项

urlRule 链接验证 ​

参数说明类型默认值
tips提示string请输入正确的链接

versionRule 版本号验证 ​

参数说明类型默认值
tips提示string请输入正确的版本号

jsonRule json验证 ​

参数说明类型默认值
tips提示string请输入正确的版本号

intNumRule 整数验证 ​

参数说明类型默认值
isCanZero是否能输0booleantrue
isCanNegative是否能输负数booleantrue

digitNumRule 小数验证 ​

参数说明类型默认值
digit小数位数number2
isCanZero是否能输0booleantrue
isCanNegative是否能输负数booleantrue

codeRule 验证码验证 ​

参数说明类型默认值
tips错误提示string请输入正确的验证码
codeLength验证码长度number6

phoneNumRule 电话号码验证 ​

参数说明类型默认值
tips错误提示string请输入正确的电话号码

numRangeRule 数字区间验证 ​

参数说明类型默认值
min区间最小值number|string-
max区间最大值number|string-
tips错误提示string输入的值必须在 ${min} 到 ${max} 之间