zoukankan      html  css  js  c++  java
  • elementui table 表格前三行第三列数据标红

     1                             <el-table
     2                                                 :cell-class-name="tableCellClassName"
     3                                                 height="350px"
     4                                                 :data="tableData"
     5                                                 style=" 100%">
     6                                             <el-table-column
     7                                                     type="index"
     8                                                     label="排名"
     9                                                     width="50">
    10                                             </el-table-column>
    11                                             <el-table-column
    12                                                     prop="mineName"
    13                                                     label="矿山名称"
    14                                                     width="180">
    15                                             </el-table-column>
    16                                             <el-table-column
    17                                                     prop="finishedRate"
    18                                                     label="完成率">
    19                                                 <template slot-scope="scope">
    20                                                     <el-row>
    21                                                         <el-col :span="18">
    22                                                             <el-progress
    23                                                                     :percentage=(scope.row.finishedRate)
    24                                                             ></el-progress>
    25                                                         </el-col>
    26                                                         <el-col :span="6" >
    27                                                             <div >
    28                                                                 {{scope.row.finishedRate+"%"}}
    29                                                             </div>
    30                                                         </el-col>
    31                                                     </el-row>
    32                                                 </template>
    33                                             </el-table-column>
    34                                        </el-table>

    js:

    tableCellClassName({row, column, rowIndex, columnIndex}: any) {
    if (rowIndex <= 2) {
    if (columnIndex == 2) {//前三行第三列表红
    return 'warning-row';
    }
    } else {
    if (columnIndex == 2) {
    return 'no-warning-row';
    }
    }

    }

    css:

    /deep/.el-table .warning-row {
            color: #ec5656;
    }
    /deep/ .el-table .no-warning-row {
    color: #01b79d;
    }

    效果:

  • 相关阅读:
    P站画师 GTZ taejune 精选4k插画壁纸
    点、向量与坐标系
    一些几何
    画直线算法 Line drawing algorithm
    DX11 学习大纲
    插值 Interpolation
    The History of Computer Graphics
    vue中的请求拦截响应
    Event loop
    小程序使用wx.navigateTo()跳转失败
  • 原文地址:https://www.cnblogs.com/yscec/p/12667938.html
Copyright © 2011-2022 走看看