微信小程序官方文档:https://developers.weixin.qq.com/miniprogram/dev/component/switch.html
1.一个开关
checked="true" 为选中状态
<switch name="switch" checked="true" />
默认样式如图
2.修改选中状态样式
.wx-switch-input {
width: 70rpx !important;
height: 40rpx !important;
background: #97c9c6 !important;
border: 0rpx solid #97c9c6 !important;
}
选中状态下的样式如图 点击关闭之后的样式
<