代码改变世界

Element UI 表格 el-table-column根据不同值显示不同颜色

2021-05-26 11:13  罗任德  阅读(2785)  评论(0编辑  收藏  举报
1 <el-table-column prop="statusDesc" label="状态" width="90">
2     <template slot-scope="scope">
3         <div :style="{'color':scope.row.status==1? 'red':'#333'}">                    
4             {{scope.row.statusDesc}}
5         </div>
6     </template>
7 </el-table-column>