微信默认样式:
修改样式:
HTML代码:
<checkbox @click="handleChoose(item)" checked="true" />
Style代码:
checkbox {
margin: 6rpx;
padding: 3px;
width: 25px;
height: 25px;
text-align: center;
box-sizing: border-box;
}
/* 未选中的 背景样式 */
checkbox .wx-checkbox-input{
border-radius: 50%;/* 圆角 */
width: 20px; /* 背景的宽 */
height: 20px; /* 背景的高 */
box-sizing: border-box;
margin-right: 10px;
}
/* 选中后的 背景样式 (背景 无边框 可根据UI需求自己修改) */
checkbox .wx-checkbox-input.wx-checkbox-input-checked{
border-radius: 50%;
border-color: #04C2C2!important;
background-color: #04C2C2!important;
}
/* 选中后的 对勾样式 (白色对勾 可根据UI需求自己修改) */
checkbox .wx-checkbox-input.wx-checkbox-input-checked::before{
content: '';
border-radius: 50%;/* 圆角 */
width: 10px;/* 选中后对勾大小,不要超过背景的尺寸 */
height: 10px;/* 选中后对勾大小,不要超过背景的尺寸 */
line-height: 10px;
text-align: center;
font-size:10px; /* 对勾大小 10px */
color:#fff; /* 对勾颜色 白色 */
transform:translate(-50%, -50%) scale(1);
-webkit-transform:translate(-50%, -50%) scale(1);
}