Add bodyStyle for drawer

This commit is contained in:
ztplz 2019-01-11 22:45:01 +08:00 committed by 偏右
parent 0e1564f499
commit 2ec3c37c42

View File

@ -24,6 +24,7 @@ export interface DrawerProps {
mask?: boolean;
maskStyle?: React.CSSProperties;
style?: React.CSSProperties;
bodyStyle?: React.CSSProperties;
title?: React.ReactNode;
visible?: boolean;
width?: number | string;
@ -182,7 +183,7 @@ class Drawer extends React.Component<DrawerProps & ConfigConsumerProps, IDrawerS
// render drawer body dom
renderBody = () => {
const { placement, prefixCls, visible } = this.props;
const { bodyStyle, placement, prefixCls, visible } = this.props;
if (this.destroyClose && !visible) {
return null;
}
@ -211,7 +212,9 @@ class Drawer extends React.Component<DrawerProps & ConfigConsumerProps, IDrawerS
onTransitionEnd={this.onDestroyTransitionEnd}
>
{this.renderHeader()}
<div className={`${prefixCls}-body`}>{this.props.children}</div>
<div className={`${prefixCls}-body`} style={bodyStyle}>
{this.props.children}
</div>
</div>
);
};