index.tsx 634 Bytes
import { Modal, ModalFuncProps } from 'antd';
import { ExclamationCircleFilled } from '@ant-design/icons';
const { confirm } = Modal;

const showPropsConfirm = (props: ModalFuncProps) => {
  const { title, icon, content, okText, okType, okButtonProps, cancelText, onOk, onCancel } = props;

  confirm({
    title: title,
    icon: icon || <ExclamationCircleFilled />,
    content: content,
    okText: okText,
    okType: okType,
    okButtonProps: okButtonProps, //是个对象,其中disabled属性就是在这里设置
    cancelText: cancelText,
    onOk: onOk,
    onCancel: onCancel,
  });
};

export default showPropsConfirm;