首页 > 其他分享 >el-table设置单元格里的字体颜色

el-table设置单元格里的字体颜色

时间:2022-12-14 12:56:46浏览次数:36  
标签:el cellStyle 单元格 columnIndex 字体 table

例如图中,设置某个单元格的字体颜色:

① 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

相关文章