重点在 css 样式上,结构引用的 uni-app官网结构
/* 复选框未选中前的样式 */
/deep/ .uni-checkbox-input {
width: 36upx;
height: 36upx;
border-radius: 50%;
margin-right: 0;
}
/* 复选框取消默认样式 */
/deep/ uni-checkbox .uni-checkbox-input.uni-checkbox-input-checked:before {
font: normal normal normal 14px/1 uni;
content: "\EA08";
font-size: 0; /* 重点使用这一步取消的默认样式 */
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-48%) scale(.73);
-webkit-transform: translate(-50%,-48%) scale(.73);
}
/* 重新定义复选框选中后的样式*/
/deep/ .uni-checkbox-input-checked::before {
width: 20upx;
height: 20upx;
/* background: #007aff; */
/* border-radius: 50%; */
background: url(../../../static/img/seal.png) no-repeat center;
}
这样就ok了。