0.0.4 • Published 6 years ago
@tydic-group/plugin-regular-check v0.0.4
plugin-regular-check
正则校验插件
Project setup
npm installCompiles and hot-reloads for development
npm run serveCompiles and minifies for production
npm run buildRun your tests
npm run testLints and fixes files
npm run lintCustomize configuration
在表单中的使用方式
ruleValidate: {
name: [
{
'required': true,
'validator': checkReg.number1.validator
}
]
}函数中的使用方式
validator函数的三个参数:
1、custom:自定义校验,也可以校验具体的值。例如:数字(number),电话(phone)......
regexp: 自定义正则
message:自定义验证提示信息
validateType:自定义校验时的校验类型
2、value值
3、回调函数
checkReg.custom.validator({dot:"",regexp:"",message:"",validateType:'number'},'aaa',(val)=>{
},{});