el-table-column根据条件修改字体颜色,el-table-column序号展示

1. el-table-column根据条件修改字体颜色

.需要使用插槽来改变

:style="{ color: scope.row.is_nucleic ==='未检测'?'red':'black'}"

    <el-table>
         <el-table-column label="是否检测" align="center" prop="is_nucleic" min-width="70px" 
            :show-overflow-tooltip="true">
            <template slot-scope="scope">
              <div :style="{ color: scope.row.is_nucleic ==='未检测'?'red':'black'}">
                {
  
   
   { scope.row.is_nucleic }}
              </div>
            </template>
          </el-table-column>
    </el

猜你喜欢

转载自blog.csdn.net/qq_39695210/article/details/127008078
今日推荐