分页

当前页  curPage

每页大小  pageSiize

总条数  tototal

总页数=Math.ceil(total/pageSize) 

      <!-- 分页 -->
      <el-pagination
        style="margin-top: 15px;text-align: right;"
        :current-page="currentPage4"
        :page-sizes="[10, 20, 30, 40]"
        :page-size="queryParam.pageInfo.pageSize"
        layout="total, sizes, prev, pager, next, jumper"
        :total="queryParam.pageInfo.total"
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
      />

      queryParam: {
        data: {
          planUnitId: null,
          planDate: null
        },
        pageInfo: {
          pageNum: 1,
          pageSize: 10,
          size: 0,
          total: 0
        }
      },


    // 表格分页
    handleSizeChange(val) {
      console.log(`每页 ${val} 条`)
      this.queryParam.pageInfo.pageSize = val
      this.pageQuery(this.queryParam)
    },
    handleCurrentChange(val) {
      console.log(`当前页: ${val}`)
      this.queryParam.pageInfo.pageNum = val
      this.pageQuery(this.queryParam)
    }
原文地址:https://www.cnblogs.com/javascript9527/p/11406260.html