mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-05 05:18:34 +08:00
为了编辑器调整 form 输出
This commit is contained in:
parent
aaaed64334
commit
73d741e273
@ -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>
|
||||||
|
Loading…
Reference in New Issue
Block a user