element table 分页功能

:data="pointData.slice(
          (page1.currentPage - 1) * page1.pageSize,
          page1.currentPage * page1.pageSize
)"
<div class="block">
//分页的数据
  page1: {
          currentPage: 1,
          pageSize: 10
       },
       page2: {
          currentPage: 1,
          pageSize: 10
       },
 
<el-pagination
        :current-page.sync="page1.currentPage"
        :page-size="page1.pageSize"
        :page-sizes="[5, 10, 20, 30, 50]"
        layout="prev, pager, next,jumper,total,sizes"
        :total="pointData.length"
        @size-change="handleSizeChange1"
        @current-change="handleCurrentChangel1"
/>
</div>
 
//分页的方法
handleSizeChange1(val) {
      this.page1.pageSize = val
},、
handleCurrentChangel1(val) {
      this.page1.currentPage = val
},
getIndex1(index) {
      return index + 1 + (this.page1.currentPage - 1) * this.page1.pageSize
},
getIndex2(index) {
      return index + 1 + (this.page1.currentPage - 1) * this.page1.pageSize
},
 

 

element table 分页功能

上一篇:报错“invalid character '<' looking for beginning of value”


下一篇:String,StringBuffer,StringBuilder三种的性能差异