elementUi給特殊的屬性值設定樣式
阿新 • • 發佈:2020-07-22
可以通過scope.row.屬性名
和三目運算子給特殊的屬性值設定樣式
類似下面的效果
<el-table-column
property="examine"
label="稽核情況"
width="">
<template slot-scope="scope">
<div :class="scope.row.examine === '待稽核' ? 'specailColor' : ''" >{{scope.row.examine}}</div>
</template>
</el-table-column>
<el-table-column
property="publish"
label="公示情況"
width="">
< template slot-scope="scope">
<div :class="scope.row.publish === '未公示' ? 'specailColor' : ''">{{scope.row.publish}}</div>
</template>
</el-table-column>