mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-04 21:19:01 +08:00
优化 form 重新渲染次数
This commit is contained in:
parent
15c65cef4c
commit
055b0b2edb
@ -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(
|
||||
nextProps.store.data,
|
||||
syncDataFromSuper(
|
||||
const diff = syncDataFromSuper(
|
||||
store.data,
|
||||
nextProps.store.data,
|
||||
props.scope,
|
||||
nextProps.dataUpdatedAt !== props.dataUpdatedAt,
|
||||
store
|
||||
)
|
||||
);
|
||||
|
||||
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
Block a user