forked from p96170835/amis
优化 form 重新渲染次数
This commit is contained in:
parent
f19df03cad
commit
070959569b
|
@ -728,19 +728,20 @@ export function HocStoreFactory(renderer: {
|
|||
);
|
||||
} else if (isObjectShallowModified(props.data, nextProps.data)) {
|
||||
if (nextProps.store && nextProps.store.data === nextProps.data) {
|
||||
const newData = createObject(
|
||||
const diff = syncDataFromSuper(
|
||||
store.data,
|
||||
nextProps.store.data,
|
||||
syncDataFromSuper(
|
||||
store.data,
|
||||
nextProps.store.data,
|
||||
props.scope,
|
||||
nextProps.dataUpdatedAt !== props.dataUpdatedAt,
|
||||
store
|
||||
)
|
||||
props.scope,
|
||||
nextProps.dataUpdatedAt !== props.dataUpdatedAt,
|
||||
store
|
||||
);
|
||||
|
||||
// todo fix: dialog 种数据从孩子 form 同步过来后,会走这个逻辑让 form 更新 data,会导致里面的 __prev 丢失。
|
||||
store.initData(newData);
|
||||
if (Object.keys(diff).length) {
|
||||
const newData = createObject(nextProps.store.data, diff);
|
||||
|
||||
// todo fix: dialog 种数据从孩子 form 同步过来后,会走这个逻辑让 form 更新 data,会导致里面的 __prev 丢失。
|
||||
store.initData(newData);
|
||||
}
|
||||
} else if (nextProps.data && (nextProps.data as any).__super) {
|
||||
store.initData(extendObject(nextProps.data));
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue