为了编辑器调整 form 输出

This commit is contained in:
liaoxuezhi 2019-12-04 18:04:12 +08:00
parent aaaed64334
commit 73d741e273

View File

@ -939,7 +939,7 @@ export default class Form extends React.Component<FormProps, object> {
subSchema.control = control = { subSchema.control = control = {
...control, ...control,
...getExprProperties(control, store.data) ...getExprProperties(control, store.data)
} };
} }
control.hiddenOn && (subSchema.hiddenOn = control.hiddenOn); control.hiddenOn && (subSchema.hiddenOn = control.hiddenOn);
@ -950,13 +950,17 @@ export default class Form extends React.Component<FormProps, object> {
} }
renderBody() { renderBody() {
const {tabs, fieldSet, controls} = this.props; const {tabs, fieldSet, controls, mode, className, classnames: cx} = this.props;
return this.renderFormItems({ return (
tabs, <div className={cx(`Form`, `Form--${mode || 'normal'}`, className)}>
fieldSet, {this.renderFormItems({
controls tabs,
}); fieldSet,
controls
})}
</div>
);
} }
render() { render() {
@ -984,11 +988,7 @@ export default class Form extends React.Component<FormProps, object> {
(/(?:\/|^)form\//.test($path as string) ? 'div' : 'form'); (/(?:\/|^)form\//.test($path as string) ? 'div' : 'form');
let body = ( let body = (
<WrapperComponent <WrapperComponent onSubmit={this.handleFormSubmit} noValidate>
onSubmit={this.handleFormSubmit}
className={cx(`Form`, `Form--${mode || 'normal'}`, className)}
noValidate
>
{debug ? ( {debug ? (
<pre> <pre>
<code>{JSON.stringify(store.data, null, 2)}</code> <code>{JSON.stringify(store.data, null, 2)}</code>