Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix: 注册异步渲染器时删除占位渲染器,修复设置了显隐条件时无法正确渲染的问题 #11544

Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions packages/amis-core/src/factory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,17 @@
);
} else if (exists) {
// 如果已经存在,合并配置,并用合并后的配置
Object.assign(exists, config);
renderer = exists;
renderer = Object.assign(exists, config);
// 如果已存在的配置有占位组件,并且新的配置是异步渲染器,在把占位组件删除
// 避免遇到设置了 visibleOn/hiddenOn 条件的 Schema 无法渲染的问题
if (
exists.component === Placeholder &&
!config.component &&
config.getComponent
) {
let {component, Renderer, ...rest} = renderer;
renderer = {...rest, ...config};
}
}

renderer.weight = renderer.weight || 0;
Expand Down
Loading