表格首列自增序号:
(当前页-1)* 当前显示数据条数 + 当前行数据的索引 + 1
代码
<el-table-column label="序号" align="center" type="index" >
<template slot-scope="scope">
<span>{{(queryParams.pageNum-1)*queryParams.pageSize+scope.$index+1}}</span>
</template>
</el-table-column>
<script>
export default {
data() {
return {
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 20,
}
}
}
</script>