mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-30 02:58:05 +08:00
Grid
This commit is contained in:
parent
95ad3a6027
commit
18863ede69
@ -511,11 +511,8 @@ addSchemaFilter(function (schema: Schema, renderer: any, props: any) {
|
|||||||
|
|
||||||
body: column?.controls.map(controlToNormalRenderer)
|
body: column?.controls.map(controlToNormalRenderer)
|
||||||
};
|
};
|
||||||
|
delete column.type;
|
||||||
delete column.controls;
|
delete column.controls;
|
||||||
if (!column.type) {
|
|
||||||
column.type = 'wrapper';
|
|
||||||
column.size = 'none';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return column;
|
return column;
|
||||||
|
@ -2,7 +2,12 @@ import React from 'react';
|
|||||||
import {Renderer, RendererProps} from '../factory';
|
import {Renderer, RendererProps} from '../factory';
|
||||||
import {Schema} from '../types';
|
import {Schema} from '../types';
|
||||||
import pick from 'lodash/pick';
|
import pick from 'lodash/pick';
|
||||||
import {BaseSchema, SchemaClassName, SchemaObject} from '../Schema';
|
import {
|
||||||
|
BaseSchema,
|
||||||
|
SchemaClassName,
|
||||||
|
SchemaCollection,
|
||||||
|
SchemaObject
|
||||||
|
} from '../Schema';
|
||||||
|
|
||||||
export const ColProps = ['lg', 'md', 'sm', 'xs'];
|
export const ColProps = ['lg', 'md', 'sm', 'xs'];
|
||||||
|
|
||||||
@ -106,6 +111,8 @@ export type GridColumnObject = {
|
|||||||
mode?: string;
|
mode?: string;
|
||||||
horizontal?: any;
|
horizontal?: any;
|
||||||
|
|
||||||
|
body?: SchemaCollection;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 列类名
|
* 列类名
|
||||||
*/
|
*/
|
||||||
@ -168,7 +175,12 @@ export default class Grid<T> extends React.Component<GridProps & T, object> {
|
|||||||
static propsList: Array<string> = ['columns'];
|
static propsList: Array<string> = ['columns'];
|
||||||
static defaultProps = {};
|
static defaultProps = {};
|
||||||
|
|
||||||
renderChild(region: string, node: Schema, key: number, length: number) {
|
renderChild(
|
||||||
|
region: string,
|
||||||
|
node: SchemaCollection,
|
||||||
|
key: number,
|
||||||
|
length: number
|
||||||
|
) {
|
||||||
const {render, itemRender} = this.props;
|
const {render, itemRender} = this.props;
|
||||||
|
|
||||||
return itemRender
|
return itemRender
|
||||||
@ -206,7 +218,12 @@ export default class Grid<T> extends React.Component<GridProps & T, object> {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
this.renderChild(`column/${key}`, column, key, length)
|
this.renderChild(
|
||||||
|
`column/${key}`,
|
||||||
|
column.type ? column : (column as any).body!,
|
||||||
|
key,
|
||||||
|
length
|
||||||
|
)
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user