修复 用法, visibleOn 不符合预期
This commit is contained in:
parent
8633e1a973
commit
7816d3682f
|
@ -420,14 +420,6 @@ class SchemaRenderer extends React.Component<SchemaRendererProps, any> {
|
|||
delete schema.$ref;
|
||||
path = path.replace(/(?!.*\/).*/, schema.type);
|
||||
}
|
||||
// value 会提前从 control 中获取到,所有需要把control中的属性也补充完整
|
||||
if (schema.control && schema.control.$ref) {
|
||||
schema.control = {
|
||||
...props.resolveDefinitions(schema.control.$ref),
|
||||
...schema.control
|
||||
}
|
||||
delete schema.control.$ref;
|
||||
}
|
||||
this.renderer = rendererResolver(path, schema, props);
|
||||
return schema;
|
||||
}
|
||||
|
|
|
@ -778,7 +778,8 @@ export default class Form extends React.Component<FormProps, object> {
|
|||
horizontal,
|
||||
store,
|
||||
disabled,
|
||||
controlWidth
|
||||
controlWidth,
|
||||
resolveDefinitions
|
||||
} = props;
|
||||
|
||||
const subProps = {
|
||||
|
@ -806,6 +807,13 @@ export default class Form extends React.Component<FormProps, object> {
|
|||
|
||||
if (subSchema.control) {
|
||||
let control = subSchema.control as Schema;
|
||||
if (control.$ref) {
|
||||
control = {
|
||||
...resolveDefinitions(control.$ref),
|
||||
...control
|
||||
}
|
||||
delete control.$ref;
|
||||
}
|
||||
control.hiddenOn && (subSchema.hiddenOn = control.hiddenOn);
|
||||
control.visibleOn && (subSchema.visibleOn = control.visibleOn);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue