Skip to content

Commit a63a613

Browse files
authored
docs: add itemType demo (#94)
1 parent bbd0e11 commit a63a613

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,24 @@ If type is `array`, there has four addition rule:
192192

193193
- `itemType` - The type of every item in this array.
194194
- `rule` - An object that validate the items of the array. Only work with `itemType`.
195+
```js
196+
/**
197+
* check array
198+
* {
199+
* type: 'array',
200+
* itemType: 'string'
201+
* rule: {type: 'string', allowEmpty: true}
202+
* }
203+
*
204+
* {
205+
* type: 'array'.
206+
* itemType: 'object',
207+
* rule: {
208+
* name: 'string'
209+
* }
210+
* }
211+
*/
212+
```
195213
- `max` - The maximum length of the array.
196214
- `min` - The minimum lenght of the array.
197215

0 commit comments

Comments
 (0)