Benjy Cui
9 years ago
2 changed files with 7 additions and 18 deletions
@ -1,25 +1,15 @@ |
|||
import React from 'react'; |
|||
import Validation from 'rc-form-validation'; |
|||
import warning from 'warning'; |
|||
|
|||
export default class AntValidation extends React.Component { |
|||
validate(callback) { |
|||
this.refs.validation.validate(callback); |
|||
} |
|||
|
|||
reset() { |
|||
this.refs.validation.reset(); |
|||
} |
|||
|
|||
forceValidate(fields, callback) { |
|||
this.refs.validation.forceValidate(fields, callback); |
|||
} |
|||
|
|||
render() { |
|||
warning(false, '`Validation` is deprecated, please use `Form` which has supported validation after antd@0.12.0.'); |
|||
return <Validation {...this.props} ref="validation" />; |
|||
warning(false, '`Validation` is removed, please use `Form` which has supported validation after antd@0.12.0,' + |
|||
' or you can just import Validation from \'rc-form-validation\' for compatibility'); |
|||
return null; |
|||
} |
|||
} |
|||
|
|||
AntValidation.Validator = Validation.Validator; |
|||
AntValidation.FieldMixin = Validation.FieldMixin; |
|||
AntValidation.Validator = () => {}; |
|||
AntValidation.FieldMixin = { |
|||
setField() {}, |
|||
}; |
|||
|
Loading…
Reference in new issue