一、模態窗口
delete(){ wx.showModal({ title: '', content: '是否確認刪除', success(res) { if (res.confirm) { console.log('用戶點擊確定') } else if (res.cancel) { console.log('用戶點擊取消') } } }) }
二、提示你想提示的信息
提示你想提示的信息
wx.showToast({ title: '成功', icon: 'success', duration: 2000})注意
wx.showLoading 和 wx.showToast 同時只能顯示一個 wx.showToast 應與 wx.hideToast 配對使用三、顯示 loading 提示框
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) }})以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持錯新站長站。
新聞熱點
疑難解答