1.在表格中某列返回的是0,1,可通过formmatter进行转换文字展示
template中:
<el-table-column
prop="status"
label="有效状态"
:formatter="statusFormate"
></el-table-column>
methods中定义
statusFormate(row, index) {
if (row.status == "1") {
return "生效中";
} else if (row.status == "0") {
return "已失效";
} else {
return "";
}
},
2.给table-column-item加上fixed属性可将某列固定在某个位置
<el-table-column
fixed="right"
>
</el-table-column>
3.在table中获取某一行数据进行操作
<el-table-column
label="操作"
>
<template slot-scope="scope">
<el-button
@click="handleDetail(scope.$index, scope.row)"
>详情</el-button>
</template>
</el-table-column>