async-validator icon indicating copy to clipboard operation
async-validator copied to clipboard

数组里面嵌套对象如何写啊!!!!!求

Open wujiantao123 opened this issue 7 years ago • 2 comments

wujiantao123 avatar Oct 21 '18 03:10 wujiantao123

array: { required: true, type: 'array', len: 1, fields: { 0: { type: 'object', required: true, message: 'xxx', fields: { num: {type: 'string', required: true}, url: {type: 'string', required: true},

          },
        }

大概是这样,不过这个包校验数组 有很多坑的,目前发现的是,1.如果是空,则校验会通过,必须初始存在空数组,2. 如果fields里面message没写,空数组也会被校验通过

Creasher avatar Oct 24 '18 06:10 Creasher

#108

TELstatic avatar Jan 31 '19 06:01 TELstatic