iview table 实现分页后序号自增
问题描述:iview使用table中type:“index” ,分页之后,每页的索引还是从1开始。
解决方法如下:
使用render函数进行处理:
page:当前第几页
pageSize:每页多少行
相关代码如下:
{
width: 80, align: 'center', title: '序号', render: (h, params) => {
return h('span', params.index + (this.page - 1) * this.pageSize + 1);
}
}
注意:要把原始的 type:‘index’ 去掉
效果如下:

转载链接: https://www.cnblogs.com/liuping666/articles/16517504.html
博客介绍了使用render函数处理分页问题的解决方法,涉及当前页码和每页行数,还给出相关代码,并提醒去掉原始的 type:‘index’,最后提供了转载链接。
1135

被折叠的 条评论
为什么被折叠?



