微信小程序彈出操作菜單
比如在頁面上放一個按鈕,點擊按鈕彈出操作菜單,那么在按鈕的 bindtap 事件里,執行下面的代碼即可:
wx.showActionSheet({ itemList: ['A', 'B', 'C'], success: function (res) { console.log(JSON.stringify(res)) console.log(res.tapIndex) // 用戶點擊的按鈕,從上到下的順序,從0開始 }, fail: function (res) { console.log(res.errMsg) } })