fix(Modal): allow ReactNode for okText and cancelText props

This commit is contained in:
kristof0425 2019-01-31 15:57:18 +01:00 committed by 偏右
parent 031876bbf3
commit e0edd82a76

View File

@ -35,11 +35,11 @@ export interface ModalProps {
/** 底部内容*/
footer?: React.ReactNode;
/** 确认按钮文字*/
okText?: string;
okText?: React.ReactNode | string;
/** 确认按钮类型*/
okType?: ButtonType;
/** 取消按钮文字*/
cancelText?: string;
cancelText?: React.ReactNode | string;
/** 点击蒙层是否允许关闭*/
maskClosable?: boolean;
/** 强制渲染 Modal*/
@ -75,9 +75,9 @@ export interface ModalFuncProps {
centered?: boolean;
width?: string | number;
iconClassName?: string;
okText?: string;
okText?: React.ReactNode | string;
okType?: ButtonType;
cancelText?: string;
cancelText?: React.ReactNode | string;
icon?: React.ReactNode;
/* Deperated */
iconType?: string;
@ -132,8 +132,8 @@ export default class Modal extends React.Component<ModalProps, {}> {
prefixCls: PropTypes.string,
onOk: PropTypes.func,
onCancel: PropTypes.func,
okText: PropTypes.string,
cancelText: PropTypes.string,
okText: PropTypes.node,
cancelText: PropTypes.node,
centered: PropTypes.bool,
width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
confirmLoading: PropTypes.bool,