import { MDialog } from "@yl/super-jssdk"
MDialog.prompt(optional)
| 参数 | 类型 | 必填 | 作用 |
|---|---|---|---|
| optional | Object | 是 | 必填参数 |
optional
| 参数 | 类型 | 必填 | 作用 |
|---|---|---|---|
| message | string | 是 | 弹框内容 |
| callback | function | 否 | 弹框取消时的回调函数 |
| options | Object | 否 | 自定义参数 |
options
| 参数 | 类型 | 必填 | 作用 |
|---|---|---|---|
| title | string | 否 | 弹框标题,默认 Alert |
| buttonLabels | array | 否 | 弹框按钮文字,默认 ['OK', 'Cancel'] |
| defaultText | string | 否 | 弹框按钮文字,默认 空字符串 |
| 参数 | 类型 | 作用 |
|---|---|---|
| resolve() | Function | 成功回调 |
| reject(err) | Function | 失败回调,err为详细错误信息,是一个json对象,例如:{"errCode":-1,"errMsg":"出错啦"} |
MDialog.prompt({message: 'test'})
.catch(err => {
console.log('插件调用失败:', err)
})