一、showToast 頁面加載效果javascript
// onLoad 事件中定義 wx.showToast({ title: '加載中', icon: 'loading', duration: 10000 })
setTimeout(function () { wx.hideToast() }, 2000)
二、showToast消息提示框css
<!--index.wxml--> <button type="primary" bindtap="showToast">showToast </button>
//index.js showToast: function () { wx.showToast({ title: '成功', icon: 'success', duration: 2000 }) }
三、showModal顯示模態彈窗java
<!--index.wxml--> <button type="default" bindtap="showModal">showModal</button>
//index.js showModal :function(){ wx.showModal({ title: '提示', content: '這是一個模態彈窗', success: function (res) { if (res.confirm) { console.log('用戶點擊肯定') } } }) }
四、showActionSheet顯示操做菜單微信
<!--index.wxml--> <button type="warn" bindtap="showActionSheet">showActionSheet</button>
//index.js showActionSheet: function () { wx.showActionSheet({ itemList: ['A', 'B', 'C'], success: function (res) { if (!res.cancel) { console.log(res.tapIndex) } } }) }
五、setNavigationBarTitle 設置導航條app
// onLoad 事件中定義 wx.setNavigationBarTitle({ title: 'Toast案例' })
更多文章請關注公衆號,謝謝 ide
聯繫方式:13128600812ui
本文分享自微信公衆號 - IT技術屋(zhanglcxyworkshop)。
若有侵權,請聯繫 support@oschina.cn 刪除。
本文參與「OSC源創計劃」,歡迎正在閱讀的你也加入,一塊兒分享。spa