From d7f765b697c76a5c8b5c3147a80e3fc0cb131454 Mon Sep 17 00:00:00 2001 From: 2betop <2betop.cn@gmail.com> Date: Mon, 2 Mar 2020 14:18:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20requiredOn=20=E5=9C=A8=20g?= =?UTF-8?q?roup=20=E4=B8=AD=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderers/Form/Group.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/renderers/Form/Group.tsx b/src/renderers/Form/Group.tsx index 3f8f9e953..cda2a4021 100644 --- a/src/renderers/Form/Group.tsx +++ b/src/renderers/Form/Group.tsx @@ -8,6 +8,7 @@ import { } from '../../utils/helper'; import cx from 'classnames'; import {FormItemWrap} from './Item'; +import getExprProperties from '../../utils/filter-schema'; export interface InputGroupProps extends RendererProps { formMode?: string; @@ -27,7 +28,7 @@ export class ControlGroupRenderer extends React.Component { } renderControl(control: any, index: any, otherProps?: any) { - const {render, disabled} = this.props; + const {render, disabled, data} = this.props; if (!control) { return null; @@ -43,6 +44,12 @@ export class ControlGroupRenderer extends React.Component { if (subSchema.control) { let control = subSchema.control as Schema; + + control = subSchema.control = { + ...control, + ...getExprProperties(control, data) + }; + control.hiddenOn && (subSchema.hiddenOn = control.hiddenOn); control.visibleOn && (subSchema.visibleOn = control.visibleOn); }