mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-01 19:38:16 +08:00
修复 requiredOn 在 group 中的问题
This commit is contained in:
parent
ae4ac50397
commit
5e15dee775
@ -8,6 +8,7 @@ import {
|
|||||||
} from '../../utils/helper';
|
} from '../../utils/helper';
|
||||||
import cx from 'classnames';
|
import cx from 'classnames';
|
||||||
import {FormItemWrap} from './Item';
|
import {FormItemWrap} from './Item';
|
||||||
|
import getExprProperties from '../../utils/filter-schema';
|
||||||
|
|
||||||
export interface InputGroupProps extends RendererProps {
|
export interface InputGroupProps extends RendererProps {
|
||||||
formMode?: string;
|
formMode?: string;
|
||||||
@ -27,7 +28,7 @@ export class ControlGroupRenderer extends React.Component<InputGroupProps> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
renderControl(control: any, index: any, otherProps?: any) {
|
renderControl(control: any, index: any, otherProps?: any) {
|
||||||
const {render, disabled} = this.props;
|
const {render, disabled, data} = this.props;
|
||||||
|
|
||||||
if (!control) {
|
if (!control) {
|
||||||
return null;
|
return null;
|
||||||
@ -43,6 +44,12 @@ export class ControlGroupRenderer extends React.Component<InputGroupProps> {
|
|||||||
|
|
||||||
if (subSchema.control) {
|
if (subSchema.control) {
|
||||||
let control = subSchema.control as Schema;
|
let control = subSchema.control as Schema;
|
||||||
|
|
||||||
|
control = subSchema.control = {
|
||||||
|
...control,
|
||||||
|
...getExprProperties(control, data)
|
||||||
|
};
|
||||||
|
|
||||||
control.hiddenOn && (subSchema.hiddenOn = control.hiddenOn);
|
control.hiddenOn && (subSchema.hiddenOn = control.hiddenOn);
|
||||||
control.visibleOn && (subSchema.visibleOn = control.visibleOn);
|
control.visibleOn && (subSchema.visibleOn = control.visibleOn);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user