async-validator
async-validator copied to clipboard
validate form asynchronous
I define a custom validator function to check my input , but my code is flawed. The error is caught but do not thrown out.
When executing a validator to validate data ```js const Validator = require('async-validator').default; const validator = new Validator( { name: { type: 'string', max: 30 } }, ); (async () =>...
请问一下你们这个 rule 下面的 触发trigger 可以自定义事件吗 ,我是用的element-ui 的文件上传组件, 想对上传后返回的参数做一个校验。看了你们的源码 貌似没有看到自定义 trigger 的地方。 rules: { location: [ { required: true, type:"array", message: '请选择注册所在地', trigger: 'blur' }, { type:"array", message: '参数类型错误'} ], checked:...
below rule is ok, required can work. ``` var descriptor = { storage: { type: 'array', required: true, trigger: 'blur', fields: { 0: {type: 'object', required: true} } } ```...
  http://2ality.com/2014/04/call-stack-size.html v8 max call stack in chrome is 1W+ , our validate series length is 370 ,so the asyncSerialArray and func call stack is over 1W+, so the...
` 采购员:{{item.buyerName+'/'+item.buyerJobNo}} 采购部门:{{item.purchaseDepartmentName}} {{itemIndex+1}} {{ scope.row.demandDate | parseTime('{y}-{m}-{d}') }} ` `ruleModel: { dataList: undefined, rules: { arrivalTimeRate: [ { required: true, message: "请评价到货及时率", trigger: "change" } ], materialRate: [ { required:...
可供使用的单文件,直接 `import`。例如: ```js import Schema from './utils/async-validator'; ```
由于我们经常会用到v-if来进行隐藏或显示控件,如果恰好本来应该进行验证的表单的子控件被隐藏掉了,但是依然进行了form.validate,此时filedSet.forEach并没有做任何事情,导致既没有resolve也没有reject,而是让validate函数退出,这样会让我们编写在validate(callback)中的callback函数无法调用,产生让人迷惑的问题。。
The Readme says > Sometimes it is necessary to transform a value before validation, possibly to coerce the value or to sanitize it in some way. To do this add...