----------状态展示
第一种方法
<el-table-column prop="sfgh" label="是否归还" align="center">
<template scope="scope">
<p v-if="scope.row.sfgh=='0'">
<el-button href="javascript:void(0)" @click="getWzghInfo(scope.$index, scope.row)">已归还</el-button>
</p>
<p v-if="scope.row.sfgh=='1'">未归还</p>
<p v-if="scope.row.sfgh=='2'">未还清</p>
</template>
</el-table-column>
第二种方法
使用formatter来实现
代码如下:
<el-table-column label="状态" :formatter="statusFormat">
</el-table-column>
methods: {
statusFormat: function(row, column) {
let status = row.status;
let statusW = "未缴费";
if(status == undefined) {
statusW = "未缴费";
}
switch(status) {
case 1:
statusW = "已缴费";
break;
case 2:
statusW = "退款申请中";
break;
}
return statusW;
}
}