提交 2ec3c37c 编写于 作者: Z ztplz 提交者: 偏右

Add bodyStyle for drawer

上级 0e1564f4
...@@ -24,6 +24,7 @@ export interface DrawerProps { ...@@ -24,6 +24,7 @@ export interface DrawerProps {
mask?: boolean; mask?: boolean;
maskStyle?: React.CSSProperties; maskStyle?: React.CSSProperties;
style?: React.CSSProperties; style?: React.CSSProperties;
bodyStyle?: React.CSSProperties;
title?: React.ReactNode; title?: React.ReactNode;
visible?: boolean; visible?: boolean;
width?: number | string; width?: number | string;
...@@ -182,7 +183,7 @@ class Drawer extends React.Component<DrawerProps & ConfigConsumerProps, IDrawerS ...@@ -182,7 +183,7 @@ class Drawer extends React.Component<DrawerProps & ConfigConsumerProps, IDrawerS
// render drawer body dom // render drawer body dom
renderBody = () => { renderBody = () => {
const { placement, prefixCls, visible } = this.props; const { bodyStyle, placement, prefixCls, visible } = this.props;
if (this.destroyClose && !visible) { if (this.destroyClose && !visible) {
return null; return null;
} }
...@@ -211,7 +212,9 @@ class Drawer extends React.Component<DrawerProps & ConfigConsumerProps, IDrawerS ...@@ -211,7 +212,9 @@ class Drawer extends React.Component<DrawerProps & ConfigConsumerProps, IDrawerS
onTransitionEnd={this.onDestroyTransitionEnd} onTransitionEnd={this.onDestroyTransitionEnd}
> >
{this.renderHeader()} {this.renderHeader()}
<div className={`${prefixCls}-body`}>{this.props.children}</div> <div className={`${prefixCls}-body`} style={bodyStyle}>
{this.props.children}
</div>
</div> </div>
); );
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册