Vue 表格中根据字段值显示不同的内容
<el-table-column label="预警" align="center" width="100"><template slot-scope="scope"><span style="background:#F70707 " v-if="scope.row.reaminingDays<=0">红色预警</span><span s
·
<el-table-column label="预警" align="center" width="100">
<template slot-scope="scope">
<span style="background:#F70707 " v-if="scope.row.reaminingDays<=0">红色预警</span>
<span style="background:#E6A23C " v-if="scope.row.reaminingDays>0 &&scope.row.reaminingDays<=30">橙色预警</span>
<span style="background:#FCF807" v-if="scope.row.reaminingDays>30 &&scope.row.reaminingDays<=90">黄色预警</span>
<span style="background:#FFFFFF" v-if="scope.row.reaminingDays>90">无</span>
</template>
</el-table-column>
<el-table-column
label="剩余天数"
align="center"
width="100"
prop="reaminingDays"
/>
更多推荐
已为社区贡献5条内容
所有评论(0)