Applet (22) action-sheet component details, Applet action-sheet
The action-sheet component is an optional menu item that is displayed from the bottom. It is estimated that it was added based on the IOS design. action-sheet has two sub-components, and action-sheet-item is each option, the action-sheet-cancel option is separated from the action-sheet-item option. Clicking this option triggers the action-sheet listener event.
Main attributes:
Wxml
<! -- Trigger action-sheet event --> <button type = "primary" bindtap = "listenerButton"> action sheet </button> <! -- The default action-sheet is hidden and is triggered by a button --> <action-sheet hidden = "{actionSheetHidden}" bindchange = "listenerActionSheet"> <block wx: for-items = "{actionSheetItems}"> <action-sheet-item >{{ item }}</action-sheet-item> </block> <! -- Automatically hide action-sheet --> <action-sheet-cancel> cancel </action-sheet-cancel> </action-sheet>
Js
Page ({data: {// text: "This is a Page" actionSheetHidden: true, actionSheetItems: ['item1', 'item2', 'item3']}, listenerButton: function () {this. setData ({// obtain the anti-actionSheetHidden :! This. data. actionSheetHidden}) ;}, listenerActionSheet: function () {this. setData ({actionSheetHidden :! This. data. actionSheetHidden})}, onLoad: function (options) {// parameters brought about by PAGE initialization options for page Jump}, onReady: function () {// page rendering completed }, onShow: function () {// page display}, onHide: function () {// page hide}, onUnload: function () {// page close }})
Related Articles:
Hello WeApp icon component
Window text Component switch component
Tabss component action-sheet
Application lifecycle button Component modal component
Page lifecycle checkbox component toast component
Modular Details form component details loading component
Data Binding input component navigator component
View component picker component audio component
Scroll-view component radio component video component
Swiper component slider component Image component