小程序常用弹窗

wx.showModal常用属性

属性 类型 默认值 必填 说明
title string 否 提示的标题
content string 否 提示的内容
showCancel boolean true 否 是否显示取消按钮
cancelText string ‘取消’ 否 取消按钮的文字,最多 4 个字符
confirmText string ‘确定’ 否 确认按钮的文字,最多 4 个字符

 wx.showToast({
            title: '取货失败',
            icon: 'loading',
            duration: 1000
          })
wx.showModal({
      title: '提示',
      content: '是否取消订单',
      confirmText: '是',
      cancelText:'否',
      success(res) {
        if (res.confirm) {
          
        }else if (res.cancel) {
          
        }
      }
    });
发布了74 篇原创文章 · 获赞 7 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/qq_38188047/article/details/103592880