feat: CURD2支持设置顶部&底部的外层CSS类 (#6929)

This commit is contained in:
RUNZE LU 2023-05-19 12:31:51 +08:00 committed by GitHub
parent dc4afd6efa
commit 0f63e1bbbc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -152,11 +152,21 @@ export interface CRUD2CommonSchema extends BaseSchema, SpinnerExtraProps {
*/
headerToolbar?: SchemaCollection;
/**
* CSS类名
*/
headerToolbarClassName?: string;
/**
*
*/
footerToolbar?: SchemaCollection;
/**
* CSS类名
*/
footerToolbarClassName?: string;
/**
*
*/
@ -235,7 +245,9 @@ export default class CRUD2 extends React.Component<CRUD2Props, any> {
'onSaved',
'onQuery',
'autoFillHeight',
'showSelection'
'showSelection',
'headerToolbarClassName',
'footerToolbarClassName'
];
static defaultProps = {
toolbarInline: true,
@ -1172,6 +1184,8 @@ export default class CRUD2 extends React.Component<CRUD2Props, any> {
footerToolbar,
// columnsTogglable 在本渲染器中渲染,不需要 table 渲染,避免重复
columnsTogglable,
headerToolbarClassName,
footerToolbarClassName,
...rest
} = this.props;
@ -1184,7 +1198,7 @@ export default class CRUD2 extends React.Component<CRUD2Props, any> {
>
<div className={cx('Crud2-filter')}>{this.renderFilter(filter)}</div>
<div className={cx('Crud2-toolbar')}>
<div className={cx('Crud2-toolbar', headerToolbarClassName)}>
{this.renderToolbar('headerToolbar', headerToolbar)}
</div>
@ -1242,7 +1256,7 @@ export default class CRUD2 extends React.Component<CRUD2Props, any> {
{/* spinner可以交给孩子处理 */}
{/* <Spinner overlay size="lg" key="info" show={store.loading} /> */}
<div className={cx('Crud2-toolbar')}>
<div className={cx('Crud2-toolbar', footerToolbarClassName)}>
{this.renderToolbar('footerToolbar', footerToolbar)}
</div>
</div>