前端之家收集整理的这篇文章主要介绍了
微信小程序(二十一)switch组件详细介绍,
前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

switch开关组件使用主要属性:

页面"
},/**
* switch开关监听
*/
listenerSwitch: function(e) {
console.log('switch类型开关当前状态-----',e.detail.value);
},/**
- checkBox类型开关监听
*/
listenerCheckBoxSwitch: function(e) {
console.log('checkBox类型开关当前状态-----',e.detail.value)
},onLoad:function(options){
// 页面初始化 options为页面跳转所带来的参数
},onReady:function(){
// 页面渲染完成
},onShow:function(){
// 页面显示
},onHide:function(){
// 页面隐藏
},onUnload:function(){
// 页面关闭
}
})
文章: