mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-04 04:58:55 +08:00
feat: deprecate Validation
This commit is contained in:
parent
fdd8dbf5e5
commit
368ee9422f
@ -1,3 +1,25 @@
|
||||
import React from 'react';
|
||||
import Validation from 'rc-form-validation';
|
||||
import warning from 'warning';
|
||||
|
||||
export default Validation;
|
||||
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" />;
|
||||
}
|
||||
}
|
||||
|
||||
AntValidation.Validator = Validation.Validator;
|
||||
AntValidation.FieldMixin = Validation.FieldMixin;
|
||||
|
Loading…
Reference in New Issue
Block a user