部分代码
首页代码如下:
<view class="copyright"> <view class="copyright_item">CopyRight:All Right Reserved</view> <view class="copyright_item">原创作者:HTML51.COM</view> <view class="copyright_item">微信小程序开发平台:51小程序</view> <view class="copyright_item"><image class="img" src="../copyright/image/logo.png"/></view> <view class="goto_counter"><button type="default" bindtap="goto_counter">点击进去控制switch的开和闭</button></view> </view>
index.wxml代码如下:
<switch checked="{{switchChecked}}"/> <button type="default" bindtap="openSwitch">打开开关</button> <button type="default" bindtap="closeSwitch">关闭开关</button> <switch checked="{{switchChecked}}"/> <button type="default" bindtap="openSwitch">打开开关</button> <button type="default" bindtap="closeSwitch">关闭开关</button>
更多小程序如何实现动态控制switch开关的开和闭示例相关文章请关注PHP中文网!
……