WeChat applet component: action-sheet display Operation Menu interpretation and analysis

Source: Internet
Author: User
This article describes in detail how to interpret and analyze the operation menu of the action-sheet component. For more information, see Action-sheet:

  • Show Operation Menu

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:

  • OBJECT parameter description:

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)

  • Success return parameters:

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!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.