mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-02 20:19:44 +08:00
parent
cbfc181fa4
commit
37e8474714
@ -12,6 +12,7 @@ import { FIELD_META_PROP } from './constants';
|
||||
export interface FormCreateOption {
|
||||
onFieldsChange?: (props: any, fields: Array<any>) => void;
|
||||
mapPropsToFields?: (props: any) => void;
|
||||
withRef?: boolean;
|
||||
}
|
||||
|
||||
export interface FormProps {
|
||||
@ -125,7 +126,12 @@ export default class Form extends React.Component<FormProps, any> {
|
||||
return getFieldProps(name, option);
|
||||
}
|
||||
this.props.form.getFieldProps = deprecatedGetFieldProps;
|
||||
return <Component {...this.props} />;
|
||||
|
||||
const withRef: any = {};
|
||||
if (options && options.withRef) {
|
||||
withRef.ref = 'formWrappedComponent';
|
||||
}
|
||||
return <Component {...this.props} {...withRef} />;
|
||||
},
|
||||
}));
|
||||
};
|
||||
|
@ -2,7 +2,7 @@
|
||||
order: 14
|
||||
title:
|
||||
zh-CN: 与 Modal 配合使用
|
||||
en-US: To use with modal
|
||||
en-US: With Modal
|
||||
---
|
||||
|
||||
## zh-CN
|
||||
|
Loading…
Reference in New Issue
Block a user