两个判断
<el-table
:data="personIdList"
style="width: 100%"
max-height="350"
>
<el-table-column
prop="sex"
label="性别"
>
<template slot-scope="scope">{{ scope.row.sex === 1 ? '男' : '女' }}</template>
</el-table-column>
</el-table>
两个以上的判断
<template slot-scope="scope">
<span
v-if="scope.row.sex == 0"
style="color: #F56C6C"
>女</span>
<span
v-else-if="scope.row.sex == 1"
style="color: #67C23A"
>男</span>
<span
v-else
style="color: #E6A23C"
>保密</span>
</template>