我这边有个需求是,根据后台返回的参数,去动态的改变el-table表格的背景色,不是改变文字颜色,有没有大神有解决办法?
我目前的代码是
<el-table-column
prop="date7"
label="历史峰值"
align="center"
>
<template slot-scope="scope">
<span v-if="scope.row.date7=='584W'" style="color:red">{{ scope.row.date7 }}</span>
<span v-else style="color: #37B328">{{ scope.row.date7 }}</span>
</template>
</el-table-column>
可以使用
cell-style
自定义单元格的样式预览:https://jsfiddle.net/w9zake72/