el-table原有的颜色是白色,需要换成其他颜色,就可以用scss的穿透来修改
.el-table {
font-size: 14px;
color: white;
background-color: transparent !important;
}
::v-deep .el-table tr {
background-color: transparent;
}
::v-deep.el-table th.el-table__cell {
background-color: transparent;
}
::v-deep .hovered-cell {
background-color: rgba(27, 84, 130, 1) !important;
}
::v-deep .el-table__body tr:hover > td {
background-color: transparent;
}
::v-deep .el-table__body-wrapper {
flex: 1;
overflow-y: auto;
height: calc(100% - 6px);
tr.el-table__row:nth-child(odd) {
border: 1px solid rgba(12, 30, 66, 0.5);
}
tr.el-table__row:nth-child(even) {
border: 1px solid rgba(12, 30, 66, 0.5);
}
tr.el-table__row:hover {
background: none;
& > td {
background: rgba(12, 30, 66, 0.5) !important;
}
}
tr.current-row {
background: none;
& > td {
background: rgba(12, 30, 66, 0.7) !important;
}
}