element-ui组件库el-radio-group的样式调整

一、效果

二、 代码

1.结构

<el-radio-group class="radioD" v-model="selectTheEmployee" style="margin: 10px 0 0 10px;height: 340px;overflow-y: auto;display: flex;flex-direction: column;">
            <el-radio  v-for="(item,index) in 100" :label="item" :key="index" style="margin-bottom: 5px;">{{item}}</el-radio>
 </el-radio-group>

2.样式

    /* 改变选择框形状 */
    .radioD >>> .el-radio__inner {
        border-radius: 2px;
    }
    /* 如果需要调整文字和单选框之间的距离 */
    .radioD >>> .el-radio__label {
        padding-left: 5px;
    }
    /* 将选中状态的图标改为对钩形式 */
    .radioD >>> .el-radio__input.is-checked .el-radio__inner::after {
        content: "";
        width: 8px;
        height: 5px;
        border: 2px solid white;
        border-top: transparent;
        border-right: transparent;
        text-align: center;
        display: block;
        position: absolute;
        top: 2px;
        left: 1px;
        /* vertical-align: middle; */
        transform: rotate(-45deg);
        border-radius: 0px;
        background: none;
    }
    /* 如果需要改变选中状态的背景色 */
    .radioD >>> .el-radio__input.is-checked .el-radio__inner {
        background: red;
    }
    /* 如果需要改变选中状态的文字颜色 */
    .radioD >>> .el-radio__input.is-checked+.el-radio__label {
        color: #3F68FF;
    }

  • 3
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值