search
HomeWeChat AppletMini Program DevelopmentWeChat applet component: action-sheet displays operation menu interpretation and analysis

action-sheet Displays the component description of the action menu:

  • Display action menu

action-sheetDisplay action menuSample code run The effect is as follows:

WeChat applet component: action-sheet displays operation menu interpretation and analysis

#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:
##AttributesString ArrayHexColor##successFunctionNoThe interface calls the callback function successfully, please see the return parameter description for detailsfailFunctionNo Callback function for interface call failurecompleteFunctionNoCallback function for end of interface call Function (executed successfully or failed) success return 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"
ParametersBooleanWhether the user cancels the selectiontapIndexNumberThe button the user clicked, In order from top to bottom, starting from 0
Type

Description

cancel

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!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools