mirror of
https://github.com/johndoe6345789/low-code-react-app-b.git
synced 2026-04-24 13:44:54 +00:00
Adjust conditional rendering for JSON UI
This commit is contained in:
@@ -13,7 +13,18 @@ export function JSONUIRenderer({
|
||||
|
||||
if (component.conditional) {
|
||||
const conditionMet = evaluateCondition(component.conditional.if, { ...dataMap, ...context })
|
||||
if (!conditionMet) {
|
||||
if (conditionMet) {
|
||||
if (component.conditional.then) {
|
||||
return (
|
||||
<JSONUIRenderer
|
||||
component={component.conditional.then as UIComponent}
|
||||
dataMap={dataMap}
|
||||
onAction={onAction}
|
||||
context={context}
|
||||
/>
|
||||
)
|
||||
}
|
||||
} else {
|
||||
return component.conditional.else ? (
|
||||
<JSONUIRenderer
|
||||
component={component.conditional.else as UIComponent}
|
||||
|
||||
Reference in New Issue
Block a user