element el-table hover与选中态颜色修改,存在斑马纹颜色修改

本文详细解释了如何使用CSS穿透技术修改ElementUIel-table的悬停、选中状态颜色,以及在添加斑马纹后的样式调整。
摘要由CSDN通过智能技术生成

1.el-table悬停高亮打开后,css穿透修改悬停颜色

::v-deep tr {
    background-color: transparent;
    color: #111111;
    th.el-table__cell {
      background-color: transparent;
      color: #fff;
      &.is-leaf {
        border: none;
      }
    }
    td.el-table__cell {
      border: none;
    }
    &:hover > td {
      // 悬停颜色 上面的不用管
      background-color: #e1f6f6 !important;
    }
  }

2.如果加了斑马纹

::v-deep .el-table__body .el-table__row--striped.hover-row td{
    background-color: #e1f6f6!important;
  }

3.点击高亮选中态同理

// 选中高亮
::v-deep .el-table__body tr.current-row > td.el-table__cell {
  background-color: rgb(115, 177, 201);
}

// 加了斑马纹后选中高亮
::v-deep .el-table__body .el-table__row--striped.current-row td.el-table__cell{
  background-color: rgb(115, 177, 201)!important;
}

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值