1.在template中
<el-table-column prop="index" label="序號" width="55" align="left"></el-table-column>
2.在方法中
// 添加序號
this.tableData.map((item, index) => {
item.index = this.tableListQuery.limit * (this.tableListQuery.page - 1) + (index + 1);
if (index === 0) {
this.curStartTerIndex = this.tableListQuery.limit * (this.tableListQuery.page - 1) + (index + 1);
}
if (index === this.tableData.length - 1) {
this.curEndTerIndex = this.tableListQuery.limit * (this.tableListQuery.page - 1) + (index + 1);
}
return item;
});