Skip to content

Commit

Permalink
feat: baidu#11128 dialog动作的data支持dataMergeData配置
Browse files Browse the repository at this point in the history
  • Loading branch information
chenwenhao committed Oct 29, 2024
1 parent 2298198 commit ee5c93c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/amis-core/src/store/iRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,12 @@ export const iRendererStore = StoreNode.named('iRendererStore')
}

const data = createObjectFromChain(chain);
const mappingData = self.action.data ?? self.action.dialog?.data;
const dataMergeMode = self.action.dataMergeMode || 'merge';
// 当配置了 data 的时候,可以控制数据追加方式,支持合并(merge)和覆盖(override)两种模式
const mappingData =
dataMergeMode === 'override'
? self.action.data ?? self.action.dialog?.data
: {...self.action.data, ...self.action.dialog?.data};
if (mappingData) {
self.dialogData = createObjectFromChain([
top?.context,
Expand Down

0 comments on commit ee5c93c

Please # to comment.