WeChat Mini Program API Interaction Feedback
wx.showToast(OBJECT)
WeChat applet displays message prompt box
OBJECT parameter description:
Sample code:
wx.showToast({ title: '成功', icon: 'success', duration: 2000 })
wx.hideToast()
Hide message prompt box
wx.showToast({ title: '加载中', icon: 'loading', duration: 10000 }) setTimeout(function(){ wx.hideToast() },2000)
wx.showModal(OBJECT)
WeChat applet displays modal pop-up window
OBJECT parameter description:
Sample code:
wx.showModal({ title: '提示', content: '这是一个模态弹窗', success: function(res) { if (res.confirm) { console.log('用户点击确定') } } })
wx.showActionSheet(OBJECT)
WeChat applet display Operation menu
OBJECT parameter description:
success return parameter description:
Sample code:
wx.showActionSheet({ itemList: ['A', 'B', 'C'], success: function(res) { if (!res.cancel) { console.log(res.tapIndex) } } })
Bug & Tip
bug
:Android
6.3.30
, returned by wx.showModal confirm is always true;