diff --git a/components/form/Form.tsx b/components/form/Form.tsx index 461f6dbed5..679cb05d71 100644 --- a/components/form/Form.tsx +++ b/components/form/Form.tsx @@ -12,6 +12,7 @@ import { FIELD_META_PROP } from './constants'; export interface FormCreateOption { onFieldsChange?: (props: any, fields: Array) => void; mapPropsToFields?: (props: any) => void; + withRef?: boolean; } export interface FormProps { @@ -125,7 +126,12 @@ export default class Form extends React.Component { return getFieldProps(name, option); } this.props.form.getFieldProps = deprecatedGetFieldProps; - return ; + + const withRef: any = {}; + if (options && options.withRef) { + withRef.ref = 'formWrappedComponent'; + } + return ; }, })); }; diff --git a/components/form/demo/form-in-modal.md b/components/form/demo/form-in-modal.md index fa33641f0b..46fcac583f 100644 --- a/components/form/demo/form-in-modal.md +++ b/components/form/demo/form-in-modal.md @@ -2,7 +2,7 @@ order: 14 title: zh-CN: 与 Modal 配合使用 - en-US: To use with modal + en-US: With Modal --- ## zh-CN