1.在表格内使用插槽(在插槽里面可以处理)
<el-table-column label="排序" align="center">
<template slot-scope="scope">
{{scope.row.bannerStatus=='1'?'确定':'未确定'}}
</template>>
</el-table-column>
2.在表格内运用计算属性
<el-table-column label="状态" align="center">
<template slot-scope="scope">
<span>{{ computedStatus(scope.row.approvalStatus) }}</span>
</template>
</el-table-column>
computed: {
computedStatus() {
return function (id) {
let str = "";
if (id == 0) {
str = "需审核";
}
if (id == 1) {
str = "已通过";
}
if (id == 2) {
str = "已拒绝";
}
if (id == 3) {
str = "已上报";
}
return str;
};
},
},