Skip to content

MessageBox 弹框 ​

命令式确认 / 提示框,返回 Promise。

基础用法 ​

API ​

ts
import { DanMessageBox } from '@dandan-ui/ui'

await DanMessageBox.alert(message, title?, options?)
await DanMessageBox.confirm(message, title?, options?)

确认时 resolve 'confirm';取消或关闭时 reject 'cancel' | 'close'。

Options ​

字段说明默认值
typeinfo / success / warning / errorinfo
confirmText / cancelText按钮文案确定 / 取消
showCancel / showConfirm按钮显隐confirm 默认显示取消
closeOnClickModal点击遮罩关闭false