- 问题情况:在表格中做出了分页功能后发现分页后的序号还是从1开始
- 解决方法:
<el-table-column
label="序号"
type="index"
width="50"
:index="count" >
new Vue({
el: "#app",
methods: { // 解决序号第二页从1开始的问题
// this.currentPage是当前页
// this.pageSize 是每页显示条目个数
count(index) {
return (this.currentPage - 1) * this.pageSize + index + 1
}
},
})