wupengfei
4 天以前 cfa7283b1d47334b648493270c88d609b956ee11
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();