mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-03 04:18:29 +08:00
fix: 修复persistData失效问题 (#2220)
This commit is contained in:
parent
b4092df595
commit
18eb69de0d
@ -448,7 +448,6 @@ export default class Form extends React.Component<FormProps, object> {
|
||||
|
||||
store.setCanAccessSuperData(canAccessSuperData !== false);
|
||||
store.setPersistData(persistData);
|
||||
persistData && store.getLocalPersistData();
|
||||
|
||||
if (simpleMode) {
|
||||
store.setInited(true);
|
||||
@ -622,7 +621,7 @@ export default class Form extends React.Component<FormProps, object> {
|
||||
}
|
||||
|
||||
async onInit() {
|
||||
const {onInit, store, submitOnInit} = this.props;
|
||||
const {onInit, store, persistData, submitOnInit} = this.props;
|
||||
if (!isAlive(store)) {
|
||||
return;
|
||||
}
|
||||
@ -652,6 +651,8 @@ export default class Form extends React.Component<FormProps, object> {
|
||||
};
|
||||
}
|
||||
|
||||
persistData && store.getLocalPersistData();
|
||||
|
||||
onInit && onInit(data, this.props);
|
||||
|
||||
submitOnInit &&
|
||||
@ -835,6 +836,10 @@ export default class Form extends React.Component<FormProps, object> {
|
||||
submit
|
||||
);
|
||||
}
|
||||
|
||||
if (store.persistData) {
|
||||
store.setLocalPersistData();
|
||||
}
|
||||
}
|
||||
|
||||
emitChange(submit: boolean) {
|
||||
|
@ -206,10 +206,6 @@ export const FormStore = ServiceStore.named('FormStore')
|
||||
|
||||
self.data = data;
|
||||
|
||||
if (self.persistData) {
|
||||
setLocalPersistData();
|
||||
}
|
||||
|
||||
// 同步 options
|
||||
syncOptions();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user