feat: Modal method add bodyStyle (#27292)

This commit is contained in:
Tom Xu 2020-10-22 11:24:49 +08:00 committed by GitHub
parent bcc05fcc18
commit b969bb4df5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 1 deletions

View File

@ -31,6 +31,7 @@ const ConfirmDialog = (props: ConfirmDialogProps) => {
direction,
prefixCls,
rootPrefixCls,
bodyStyle,
} = props;
devWarning(
@ -95,7 +96,7 @@ const ConfirmDialog = (props: ConfirmDialogProps) => {
getContainer={getContainer}
>
<div className={`${contentPrefixCls}-body-wrapper`}>
<div className={`${contentPrefixCls}-body`}>
<div className={`${contentPrefixCls}-body`} style={bodyStyle}>
{icon}
{props.title === undefined ? null : (
<span className={`${contentPrefixCls}-title`}>{props.title}</span>

View File

@ -114,6 +114,7 @@ export interface ModalFuncProps {
transitionName?: string;
maskTransitionName?: string;
direction?: string;
bodyStyle?: React.CSSProperties;
}
export interface ModalLocale {

View File

@ -65,6 +65,7 @@ The items listed above are all functions, expecting a settings object as paramet
| Property | Description | Type | Default | Version |
| --- | --- | --- | --- | --- |
| autoFocusButton | Specify which button to autofocus | null \| `ok` \| `cancel` | `ok` | |
| bodyStyle | Body style for modal body element. Such as height, padding etc | CSSProperties | | |
| cancelButtonProps | The cancel button props | [ButtonProps](/components/button/#API) | - | |
| cancelText | Text of the Cancel button with Modal.confirm | string | `Cancel` | |
| centered | Centered Modal | boolean | false | |

View File

@ -68,6 +68,7 @@ cover: https://gw.alipayobjects.com/zos/alicdn/3StSdUlSH/Modal.svg
| 参数 | 说明 | 类型 | 默认值 | 版本 |
| --- | --- | --- | --- | --- |
| autoFocusButton | 指定自动获得焦点的按钮 | null \| `ok` \| `cancel` | `ok` | |
| bodyStyle | Modal body 样式 | CSSProperties | | 4.8.0 |
| cancelButtonProps | cancel 按钮 props | [ButtonProps](/components/button/#API) | - | |
| cancelText | 设置 Modal.confirm 取消按钮文字 | string | `取消` | |
| centered | 垂直居中展示 Modal | boolean | false | |