<el-table :data="数据表" style="width: 100%">
<el-table-column type="index" :index="indexMethod" label="序号" width="70" align="center">
</el-table-column>
</el-table>
methods: {
// 序号自增--方法
indexMethod(index) {
// 拿到页码
const currentPage = this.queryParams.pageNum;
// 拿到每页记录条数
const pageSize = this.queryParams.pageSize;
// 根据值进行计算返回
return (index + 1) + (currentPage - 1) * pageSize;
},
}
10-18
2861
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
01-11
1971
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
07-24
503
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
08-31
599
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
06-15
2756
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)