html
<div class="select-icon-wrapper">
<input :id="element-id" v-model="selectRadio" type="radio" :value="element-id" />
<label :for="element-id"></label>
</div>
scss
.select-icon-wrapper {
font-size: 20px;
position: absolute;
right: 10px;
top: 50%;
transform: translateY(-50%);
input[type="radio"] {
width: 20px;
height: 20px;
opacity: 0;
}
label {
position: absolute;
left: 5px;
top: 3px;
width: 20px;
height: 20px;
border-radius: 50%;
border: 1px solid #999;
}
input:checked+label {
background-color: #fe6d32;
border: 1px solid #fe6d32;
}
input:checked+label::after {
position: absolute;
content: "";
width: 5px;
height: 10px;
top: 3px;
left: 6px;
border: 2px solid #fff;
border-top: none;
border-left: none;
transform: rotate(45deg);
}
}
显示效果