el-radio改变正方形
时间: 2023-10-02 12:04:36 浏览: 216
EL-IOT-II实验箱使用说明书
要将el-radio的样式改为正方形,你可以使用以下CSS代码:
```css
/deep/ .el-radio__inner {
border-radius: 0px !important;
}
/deep/ .el-radio__input.is-checked .el-radio__inner::after {
content: '';
width: 10px;
height: 10px;
border: 1px solid white;
border-top: transparent;
border-right: transparent;
text-align: center;
display: block;
position: absolute;
top: 2px;
left: 2px;
transform: rotate(-45deg);
border-radius: 0px;
background: none;
}
```
这段代码使用了/deep/选择器来穿透组件样式,将.el-radio__inner的border-radius属性设置为0,使其呈现正方形的外观。同时,修改了选中状态下.el-radio__inner::after的样式,使其成为一个边长为10px的正方形。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [elementUi vue el-radio 监听选中变化的实例代码](https://download.csdn.net/download/weixin_38576779/14820744)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [el-radio单选框样式修改为多选框样式](https://blog.csdn.net/qq_45479398/article/details/129120162)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [使用element-ui中的el-radio时,如何修改为正方形勾选](https://blog.csdn.net/qq_42690194/article/details/126488850)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文