修复 options 可能不会初始拉取 source 接口的问题

This commit is contained in:
liaoxuezhi 2019-05-09 17:10:51 +08:00
parent 74db3c0085
commit f151321a71

View File

@ -299,10 +299,10 @@ export default class Form extends React.Component<FormProps, object> {
submitOnInit submitOnInit
} = this.props; } = this.props;
store.setInited(true);
const hooks:Array<(data:any) => Promise<any>> = this.hooks['init'] || []; const hooks:Array<(data:any) => Promise<any>> = this.hooks['init'] || [];
await Promise.all(hooks.map(hook => hook(store.data))); await Promise.all(hooks.map(hook => hook(store.data)));
store.setInited(true);
onInit && onInit(store.data); onInit && onInit(store.data);
submitOnInit && this.handleAction(undefined, { submitOnInit && this.handleAction(undefined, {