Applet (21) switch component details, Applet switch
Main attributes of the switch component:
Wxml
<! -- Switch type switch --> <view> switch type switch </view> <switch type = "switch" checked = "true" bindchange = "listenerSwitch"/> <! -- Checkbox type switch --> <view> checkbox type switch </view> <switch type = "checkbox" bindchange = "listenerCheckboxSwitch"/>
Js
Page ({data: {// text: "This is a Page"},/*** switch listener */listenerSwitch: function (e) {console. log ('Switch type switch current status ----- ', e. detail. value) ;},/*** checkbox type switch listener */listenerCheckboxSwitch: function (e) {console. log ('checkbox type switch current status ----- ', e. detail. value)}, onLoad: function (options) {// parameters of 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