This article describes in detail how to interpret and analyze the operation menu of the action-sheet component. For more information, see
Action-sheet:
Action-sheet: show the sample code of the Operation Menu. the running effect is as follows:
The following is the WXML code:
Pop up ActionSheet
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]) } } }) }
Main properties of the action-sheet operation menu:
|
Attribute |
Type |
Required |
Description |
| ItemList |
String Array |
Yes |
The text array of the button. The maximum length of the array is 6. |
| ItemColor |
HexColor |
No |
The text color of the button. the default value is "#000000" |
| Success |
Function |
No |
The callback function that successfully calls the API. for details, refer to the return parameter description. |
| Fail |
Function |
No |
Callback function for interface call failure |
| Complete |
Function |
No |
The callback function after the interface call ends. (the callback function is executed if the call succeeds or fails) |
|
Parameters |
Type |
Description |
| Cancel |
Boolean |
Whether the user cancels the selection |
| TapIndex |
Number |
The user clicks the button from top to bottom, starting from 0. |
The above is the mini-program component: action-sheet displays the detailed content for interpreting and analyzing the Operation Menu. For more information, see other related articles in the first PHP community!