再HTML中绑定一下
<el-table-column
prop="studentSex" :formatter="formatRole"
label="学生性别">
</el-table-column>
数据转化
methods:{
formatRole: function( row, column) {
return row.studentSex == '1' ? "男" : row.studentSex == '2' ? "女" : " cc";
},
},