el-table的 :cell-style用法
实现表格固定行文字高亮效果
<el-tableref="table"borderstripe:data="list":height="height"highlight-current-row:cell-style="cellStyle"><el-table-columnprop="code"label="规则编码":min-width="120"show-overflow-tooltip><template slot-scope="{ row }"><el-popoverv-show="row.error"placement="top"trigger="hover"content="规则异常"><i slot="reference" class="remark-icon el-icon-warning-outline" /></el-popover>{{ row.code}}</template></el-table-column></el-table>
cellStyle({ rowIndex }) {const rowsToHighlight = []this.list.forEach((item, index) => {if (item.error) {rowsToHighlight.push(index)}})if (rowsToHighlight.includes(rowIndex)) {return 'color: #F59A23;'}return ''},