添加属性
<el-table highlight-current-row />
设置样式
- 记得加 /deep/ 前缀
高亮第一行
<style lang="scss" scoped>
/deep/ .el-table__body tr:first-child>td{
background-color: #a4c9f0 !important;
color: #fff;
}
</style>
高亮被点击的行
<style lang="scss" scoped>
/deep/ .el-table__body tr.current-row>td{
background-color: #69A8EA !important;
color: #fff;
}
</style>