原創(chuàng)文章捷犹,歡迎轉載乌昔。轉載請注明:轉載自IT人故事會雷逆,謝謝!
原文鏈接地址:「小程序JAVA實戰(zhàn)」小程序的微信api菜單操作(67)
菜單按鈕的介紹粟矿,點在視頻詳情時會出現菜單按鈕凰棉,里面有多個選項。源碼:https://github.com/limingios/wxProgram.git 中No.15和springboot
官方介紹
https://developers.weixin.qq.com/miniprogram/dev/api/ui/interaction/wx.showActionSheet.html
菜單選項代碼
如果選擇“取消” 不會進入success 方法中陌粹。
shareMe:function(){
wx.showActionSheet({
itemList: ["下載到本地","舉報用戶","分享到好友"],
success:function(res){
if (res.tapIndex==0){
} else if (res.tapIndex==1){
} else{
}
}
})
}
PS:菜單選項方便選擇撒犀,在日常小程序開發(fā)中很常見。