VUE实现table-column特定值修改颜色,其他情况保持原值
代码<el-table-column prop="level" label="级别"><template scope="scope"><span v-if="scope.row.level=='严重'" style="color: red">严重</span><span v-else>{{scope.row.level}}</spa
·
代码
<el-table-column prop="level" label="级别">
<template scope="scope">
<span v-if="scope.row.level=='严重'" style="color: red">严重</span>
<span v-else>{{scope.row.level}}</span>
</template>
</el-table-column>
参考资料和代码:
https://www.cnblogs.com/tzwbk/p/12667695.html
<el-table-column prop="isPass" label="是否通过">
<template scope="scope">
<span v-if="scope.row.isPass==='审核通过'" style="color: green">审核通过</span>
<span v-else-if="scope.row.isPass==='待审核'">待审核</span>
<span v-else style="color: red">未通过</span>
</template>
</el-table-column>
更多推荐
已为社区贡献1条内容
所有评论(0)