vue之el-table某一列设置样式
方法一在el-table设置属性cell-style方法<el-table:cell-style="setRowStyle">.........</el-table>在method中设置setRowStyle(row, column, rowIndex, columnIndex) {if(row.istable === "1"){return 'color: red'}el
·
方法一
在el-table设置属性cell-style方法
<el-table
:cell-style="setRowStyle">
.........
</el-table>
在method中设置
setRowStyle(row, column, rowIndex, columnIndex) {
if(row.status=== "1"){
return 'color: green'
}else{
return 'color: red'
}
}
方法二
<el-table-column prop="status" label="状态">
<template scope="scope">
<span v-if="scope.row.status==='1'" style="color: green">成功</span>
<span v-else-if="scope.row.status==='2'">失败</span>
<span v-else style="color: red">未知</span>
</template>
</el-table-column>
更多推荐
已为社区贡献3条内容
所有评论(0)