zoukankan      html  css  js  c++  java
  • 表格字体变色

    最近项目需要使表格字体变色,具体需求如下:

     在表格中,分为2类,需要处理。

    1、 template slot-scope="scope"

    2、 直接写在label上的。el-table-column label="证件名称" 

    解决方法:

    第一类、 简单粗暴的直接 v-if去判断

     <template slot-scope="scope">
                    <font v-if="scope.row.certificateStatus === 2">通过</font>
                    <font v-else-if="scope.row.certificateStatus === 1"  color="red">待审核</font>
                    <font v-else="scope.row.certificateStatus === 3" color="red">驳回</font>
                  </template>

    第二类:

    1、 在el-table加上:cell-style="cellStyle"。

    2、 然后判断label

     <el-tab :cell-style="cellStyle"></el-tab>
    
      cellStyle(row, column, rowIndex, columnIndex) {
          console.log(row);
          if (
            row.column.label == "完美状态" &&
            row.row.certificateStatus == "1"
          ) {
            return "color:red";
          }
        }
  • 相关阅读:
    内置方法(item系列、__str__方法、__del__方法)
    POJ3436
    CF551B
    HDU1588
    HDU3117
    CF834D
    CF832D
    CF832C
    POJ1930
    POJ3666
  • 原文地址:https://www.cnblogs.com/0520euv/p/11717842.html
Copyright © 2011-2022 走看看