● 显示模态对话框showModal

分类:交互

是否支持H5:支持

参数
Object object

参数名 类型 默认值 必填 说明
title string 弹窗标题
content string 弹窗提示内容
showCancel boolean 是否显示取消按钮
confirmText string 确认按钮文本
cancelText string 取消按钮文本
cancelColor string #000000 取消按钮的文字颜色,必须是 16 进制格式的颜色字符串
confirmColor string #576B95 确认按钮的文字颜色,必须是 16 进制格式的颜色字符串
success function 接口调用成功的回调函数
fail function 接口调用失败的回调函数
complete function 接口调用结束的回调函数(接口调用成功、失败都会执行)

调用示例

原生
wx.showModal({
    title: '弹窗标题',
    content: '弹窗内容,告知当前状态、信息和解决方法,描述文字尽量控制在三行内',
    showCancel: true,
    confirmText: '确定',
    cancelText: '取消'
    success: function (res) {
        console.log(res)
    }
})
H5
const _data = {
    title: '弹窗标题',
    content: '弹窗内容,告知当前状态、信息和解决方法,描述文字尽量控制在三行内',
    showCancel: true,
    confirmText: '确定',
    cancelText: '取消'
}
PAMINA.call('showModal', _data, res => {
    console.log(res)
}, e => {
    console.log(e)
})
小程序团队 © 2020-2021 all right reserved,powered by Gitbook文件修订时间: 2026-01-05 11:12:01

results matching ""

    No results matching ""