form 添加外部修改值的方法

This commit is contained in:
2betop 2020-06-29 13:03:41 +08:00
parent 19492f4eda
commit a9fecaeb35

View File

@ -460,6 +460,18 @@ export default class Form extends React.Component<FormProps, object> {
return store.clearErrors();
}
getValues() {
const {store} = this.props;
this.flush();
return store.data;
}
setValues(value: any) {
const {store} = this.props;
this.flush();
store.setValues(value);
}
submit(fn?: (values: object) => Promise<any>): Promise<any> {
const {store, messages, translate: __} = this.props;
this.flush();