form中容器组件中配置form时,修改内层的form会自动触发上层form的提交操作

This commit is contained in:
rickcole 2020-05-12 14:41:00 +08:00
parent 6f706349a6
commit a39a4aba46
6 changed files with 7 additions and 2 deletions

View File

@ -12,6 +12,8 @@ export interface ContainerProps extends FormControlProps {}
sizeMutable: false sizeMutable: false
}) })
export class ContainerControlRenderer extends Container<ContainerProps> { export class ContainerControlRenderer extends Container<ContainerProps> {
static propsList: Array<string> = ['onChange'];
renderBody(): JSX.Element | null { renderBody(): JSX.Element | null {
const { const {
renderFormItems, renderFormItems,

View File

@ -20,7 +20,7 @@ const defaultHorizontal = {
sizeMutable: false sizeMutable: false
}) })
export class GridRenderer extends Grid<GridProps> { export class GridRenderer extends Grid<GridProps> {
static propsList: Array<string> = ['columns']; static propsList: Array<string> = ['columns', 'onChange'];
static defaultProps = {}; static defaultProps = {};
renderChild(region: string, node: Schema, key: number, length: number) { renderChild(region: string, node: Schema, key: number, length: number) {

View File

@ -16,7 +16,7 @@ interface HBoxProps extends FormControlProps {
sizeMutable: false sizeMutable: false
}) })
export class HBoxRenderer extends React.Component<HBoxProps, any> { export class HBoxRenderer extends React.Component<HBoxProps, any> {
static propsList: Array<string> = ['columns']; static propsList: Array<string> = ['columns', 'onChange'];
static defaultProps: Partial<HBoxProps> = {}; static defaultProps: Partial<HBoxProps> = {};
renderColumn(column: any, key: number, length: number) { renderColumn(column: any, key: number, length: number) {

View File

@ -10,6 +10,7 @@ import cx from 'classnames';
name: 'panel-control' name: 'panel-control'
}) })
export class PanelRenderer extends Panel { export class PanelRenderer extends Panel {
static propsList: Array<string> = ['onChange'];
renderBody(): JSX.Element | null { renderBody(): JSX.Element | null {
const { const {
render, render,

View File

@ -15,6 +15,7 @@ import {ServiceStore, IServiceStore} from '../../store/service';
name: 'service-control' name: 'service-control'
}) })
export class ServiceRenderer extends BasicService { export class ServiceRenderer extends BasicService {
static propsList: Array<string> = ['onChange'];
static contextType = ScopedContext; static contextType = ScopedContext;
componentWillMount() { componentWillMount() {

View File

@ -14,6 +14,7 @@ export class TabsRenderer extends Tabs {
static defaultProps = { static defaultProps = {
mountOnEnter: false // form 中的不按需渲染 mountOnEnter: false // form 中的不按需渲染
}; };
static propsList: Array<string> = ['onChange', 'tabs'];
renderTab = (tab: any, props: any, key: number) => { renderTab = (tab: any, props: any, key: number) => {
const { const {