1.可以使用插槽:slot-scope="scope",使用判断来显示对应的状态
<el-table>
<el-table-column
prop="state"
label="状态"
align="center"
>
<template slot-scope="scope">
<span v-if="scope.row.state === true">启用</span>
<span v-if="scope.row.state === false">禁用</span>
</template>
</el-table-column>
</el-table>
2.可以给el-table-column添加一个属性:formatter
<template>
<el-table>
<el-table-column label="状态" prop="state" :formatter="stateFormat"></el-table-column>
</el-table>
</template>
<script>
methods:{
stateFormat(row, column) {
if (row.state === true) {
return '正确'
} else {
return '错误'
}
},
}
</script>