Vue中el-table-column中使用三目表达式动态改变样式

753 阅读1分钟

1、代码如下:

<el-table-column label="来电环比"  min-width="100">   
      <template slot-scope="scope"> 
       <span :style="{ color: scope.row.值> 0 ?'red': scope.row.值< 0 ?'#00D031':'#000' }" >
       {{ scope.row.inCallNumRoundCompare }}</span>    
      </template>      
  </el-table-column>