Form: clearValidate supports string type param (#12990)

pull/13054/head
刘晓 2018-10-15 15:54:55 +08:00 committed by hetech
parent 9e6cdd788c
commit a9026606e0
1 changed files with 4 additions and 1 deletions

View File

@ -85,7 +85,10 @@
},
clearValidate(props = []) {
const fields = props.length
? this.fields.filter(field => props.indexOf(field.prop) > -1)
? (typeof props === 'string'
? this.fields.filter(field => props === field.prop)
: this.fields.filter(field => props.indexOf(field.prop) > -1)
)
: this.fields;
fields.forEach(field => {
field.clearValidate();