欢迎光临,了解微信小程序开发,就上易用通!

微信小程序之弹框提示信息

发布:2021-06-23 14:45浏览: 来源:网络 作者:huan

一、模态窗口
wx.showModal

 delete(){
    wx.showModal({
      title: '',
      content: '是否确认删除',
      success(res) {
        if (res.confirm) {
          console.log('用户点击确定')
        } else if (res.cancel) {
          console.log('用户点击取消')
        }
      }
    })
  }

微信小程序之弹框提示信息(图1)

二、提示你想提示的信息

提示你想提示的信息

wx.showToast({
  title: '成功',
  icon: 'success',
  duration: 2000
})

注意
wx.showLoading 和 wx.showToast 同时只能显示一个
wx.showToast 应与 wx.hideToast 配对使用

三、显示 loading 提示框

wx.showLoading

wx.showLoading({
  title: '加载中',
})

setTimeout(function () {
  wx.hideLoading()
}, 2000)
四、 wx.showActionSheet(OBJECT)
wx.showActionSheet({
  itemList: ['A', 'B', 'C'],
  success: function(res) {
    console.log(res.tapIndex)
  },
  fail: function(res) {
    console.log(res.errMsg)
  }





免责声明:本站所有文章和图片均来自用户分享和网络收集,文章和图片版权归原作者及原出处所有,仅供学习与参考,请勿用于商业用途,如果损害了您的权利,请联系网站客服处理。