例如图中,设置某个单元格的字体颜色:
① el-table标签上添加属性::cell-style=“cellStyle”
<el-table :data="tableData" :cell-style="cellStyle" border stripe fit>
②vue文件里在method里声明 cellStyle方法
cellStyle({ row, column, rowIndex, columnIndex }) {
if (columnIndex === 0 || columnIndex === 1) {
return "font-weight:700;color:#FF6100 ";
}
return "";
}
标签:el,cellStyle,单元格,columnIndex,字体,table
From: https://www.cnblogs.com/mahmud/p/16981758.html