<el-table-column
prop="status"
:label="$t('pageEventLogs.table.status')"
width="180">
<template slot-scope="scope">
<div>
<span v-if="scope.row.status === 'OK'" ><img src="@/assets/images/correct.png" alt=""></span>
<span v-else ><img src="@/assets/images/error.png" alt=""></span>
<span>{{ scope.row.status }}</span>
</div>
</template>
</el-table-column>
在上述代码中,我们使用了el-table-column的prop属性指定了数据的字段名为"value",并使用slot-scope来自定义列的内容。在自定义的插槽中,我们首先显示数值的元素,然后使用v-if条件语句来判断数值是否等于1,如果是,则显示对应的图标元素。