微信小程序checkbox默认默认样式显得非常不美观,需对其进行样式美化,

样式美化后的结果:

代码如下:
html:
<checkbox-group data-id="{{item.goods_id}}" bindchange="handleItemCheck">
<checkbox checked="{{item.checked}}"></checkbox>
</checkbox-group>
css:
checkbox .wx-checkbox-input {
width: 34rpx;
height: 34rpx;
border-radius: 50%;
}
/*checkbox选中后样式 */
checkbox .wx-checkbox-input.wx-checkbox-input-checked {
background: #DB2618;
border-color:#DB2618;
}
/*checkbox选中后图标样式 */
checkbox .wx-checkbox-input.wx-checkbox-input-checked::before {
width: 20rpx;
height: 20rpx;
line-height: 20rpx;
text-align: center;
font-size: 22rpx;
color: #fff;
background: transparent;
transform: translate(-50%, -50%) scale(1);
-webkit-transform: translate(-50%, -50%) scale(1);
}








