|
@@ -122,7 +122,7 @@ class Form extends BaseComponent<BaseFormProps, BaseFormState> {
|
|
|
constructor(props: BaseFormProps) {
|
|
|
super(props);
|
|
|
this.state = {
|
|
|
- formId: getUuidv4(),
|
|
|
+ formId: '',
|
|
|
};
|
|
|
warning(
|
|
|
Boolean(props.component && props.render),
|
|
@@ -145,6 +145,10 @@ class Form extends BaseComponent<BaseFormProps, BaseFormState> {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ componentDidMount() {
|
|
|
+ this.foundation.init();
|
|
|
+ }
|
|
|
+
|
|
|
componentWillUnmount() {
|
|
|
this.foundation.destroy();
|
|
|
this.foundation = null;
|
|
@@ -173,6 +177,11 @@ class Form extends BaseComponent<BaseFormProps, BaseFormState> {
|
|
|
notifyReset: () => {
|
|
|
this.props.onReset();
|
|
|
},
|
|
|
+ initFormId: () => {
|
|
|
+ this.setState({
|
|
|
+ formId: getUuidv4()
|
|
|
+ });
|
|
|
+ },
|
|
|
getInitValues: () => this.props.initValues,
|
|
|
getFormProps: (keys: undefined | string | Array<string>) => {
|
|
|
if (typeof keys === 'undefined') {
|