action-sheet Displays the component description of the action menu:
Display action menu
action-sheetDisplay action menuSample code run The effect is as follows:
#The following is the WXML code:
# #<button>弹出ActionSheet</button>
The following is the JS code:
##actionSheetTap: function () {
var itemList= ['A', 'B', 'C']
wx.showActionSheet({
itemList:itemList,
success: function (res) {
if (!res.cancel) {
console.log(itemList[res.tapIndex])
}
}
})
}
action-sheet displays the main properties of the action menu:
OBJECT parameter description:Type |
Required |
Description |
itemList |
is the text array of the | button. The maximum length of the array is 6 | itemColor | |
No | The text color of the button, the default is "#000000" | ##success | Function |
The interface calls the callback function successfully, please see the return parameter description for details | fail | Function | |
Callback function for interface call failure | complete | Function | |
Callback function for end of interface call Function (executed successfully or failed) |
Type | Description | cancel | Boolean
tapIndex | Number | |
The above is the detailed content of WeChat applet component: action-sheet displays operation menu interpretation and analysis. For more information, please follow other related articles on the PHP Chinese website!