vue table 行改变颜色
•
前端
- 改变表格行背景色
el-table :cell-
//设置表格背景颜色
TableCellStyle(row: any, column: any, rowIndex: any, columnIndex: any) {
if (!row.columnIndex) {
return 'background-color: #e2e7ea';
} else {
if (row.columnIndex < 11) {
return 'background-color: #e2e7ea';
} else {
return null;
}
}
}
- 改变行文字颜色
方案一
el-table :row-class-name="tableAddClass"
tableAddClass({row,rowIndex}) {
if (row.is_halt) {
return 'tr-red';
}
return '';
}
.el-table .tr-red {
color: red !important;
}
方案二
el-table :cell-
//设置表格背景颜色
TableCellStyle(row: any, column: any, rowIndex: any, columnIndex: any) {
if (!row.columnIndex) {
return 'color: #e2e7ea';
} else {
if (row.columnIndex < 11) {
return 'color: #e2e7ea';
} else {
return null;
}
}
}
本文来自网络,不代表协通编程立场,如若转载,请注明出处:https://net2asp.com/a7598460e5.html
