微信小程序-弹窗组件

自定义弹窗组件:https://www.cnblogs.com/Post-90sDachenchen/p/13636668.html#4795824

参考2:https://www.jianshu.com/p/4a2e8ca47ded

微信小程序自带弹窗组件 wx.showModal

js示例:
popConfirm: function(){
  wx.showModal({
    title: 'confirm的弹窗',
    content: '确认要删除该项吗?',
    showCancel: true,
    success: function (res) {
      if (res.confirm) { 
      console.log('点击确认回调')
      } else { 
      console.log('点击取消回调')
      }
    }
  })
}
showCancel 为false 时不显示取消按钮
posted @ 2021-01-07 16:10  小二柯  阅读(230)  评论(0编辑  收藏  举报