This article mainly introduces the use of the switch selector of the WeChat applet in detail. It has certain reference value. Interested friends can refer to it.
This article shares with you the WeChat applet switch selector. How to use the program switch switch selector is for your reference. The specific content is as follows
Rendering
##WXML状态:{{isChecked1}} 状态:{{isChecked2}} 状态:{{isChecked3}} 状态:{{isChecked4}} 状态:{{isChecked5}} 状态:{{isChecked6}}
var pageObj = { data: { isChecked1: false, isChecked2: true, isChecked3: false, isChecked4: true, isChecked5: false, isChecked6: true } }; for (var i = 0; i < 7; ++i) { (function (i) { pageObj['changeSwitch' + i] = function (e) { var changedData = {}; changedData['isChecked' + i] = !this.data['isChecked' + i]; this.setData(changedData); } })(i) } Page(pageObj);
How to implement offset and uniform animation in JS
How to implement table merge cells in Bootstrap
How to get the first value in the select drop-down box in JavaScript
The above is the detailed content of How to use switch selector in WeChat applet. For more information, please follow other related articles on the PHP Chinese website!