赞
踩
问题现象:
el-table结合el-pagination实现表格分页功能时,当需要在表格的第一列显示序号,并且点击分页时,如果不做处理,序号每页都是从1开始。如果想实现自增长的效果,需要做如下处理:
- <el-table size="mini" :data="tableData" height="250" border style="width: 100%">
- <el-table-column
- type="index"
- width="90"
- :index="indexMethod"
- label="Index">
- </el-table-column>
- </el-table>
- indexMethod(index) {
- // this.currentPage 当前页码
- // this.listStep 每页条数
- return (this.currentPage- 1) * this.pageSize + index + 1;
- }
如果帮助到您了,可以留下一个赞
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。