zhengyiming
2 天以前 92264a516c8c695c38d4cc9358c50bcfbed36f06
packages/utils/message.tsx
@@ -25,11 +25,17 @@
  title?: string;
  message?: string | VNode;
  confirmText?: string;
  showCancelBtn?: boolean;
};
export class Message {
  static confirm(options: ConfirmOptions = {}) {
    const { title = '提示', message = '确定要删除该数据吗?', confirmText = '确认' } = options;
    const {
      title = '提示',
      message = '确定要删除该数据吗?',
      confirmText = '确认',
      showCancelBtn = true,
    } = options;
    return new Promise((resolve, reject) => {
      Portal.add((key) => {
        return (
@@ -42,6 +48,7 @@
                  title={title}
                  visible={open.value}
                  content={message}
                  showCancelBtn={showCancelBtn}
                  onCancel={() => {
                    onClose();
                    reject();
@@ -51,6 +58,11 @@
                    resolve(1);
                  }}
                  confirmText={confirmText}
                  //@ts-ignore
                  onClickOverlay={() => {
                    onClose();
                    reject();
                  }}
                ></Model>
              ),
            }}