uniapp checkbox label invalid

Recently, I was working on the uniapp project. When I used the checkbox tag, I found that the label effect was invalid, but the effect of the official website was good. The failure diagram is shown below. After comparing the console styles, I found that the invalid code did not write the style. When using
failure diagram
uniapp to create the project , the item with the checkbox style is not created, so even with the label, it doesn't have the desired effect.

mouse click change

Unchecked
insert image description here
Checked
insert image description here
Solution:
Add the following code in App.vue:

uni-checkbox .uni-checkbox-input {
    
    
			border-radius: 3upx !important;
			color: #ffffff !important;
		}
		
		uni-checkbox .uni-checkbox-input.uni-checkbox-input-checked {
    
    
			color: #fff;
			border-color: rgb(0, 122, 255);
			background: rgb(0, 122, 255);
		}
		uni-checkbox .uni-checkbox-input.uni-checkbox-input-checked:after {
    
    
			font-size: 18px;
		}

achieve effect
insert image description here

Guess you like

Origin blog.csdn.net/weixin_41886421/article/details/106578465#comments_26178485