Browse Source

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

pull/14682/head
kristof0425 6 years ago
committed by 偏右
parent
commit
e0edd82a76
  1. 12
      components/modal/Modal.tsx

12
components/modal/Modal.tsx

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

Loading…
Cancel
Save