vue element 分页

   <el-pagination
        :current-page="currentPage"
        :page-sizes="[10, 30, 50]"
        :page-size="pageSize"
        layout="total, sizes, prev, pager, next, jumper"
        :total="totalCount"
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
      />
 
  handleSizeChange(val) {
      // console.log("每页" + val + "条");
      // this.pageSize 是请求表格数据接口中的参数 设置表格每页显示多少条数据
      this.pageSize = val
      this.loadTableData() // 调表格数据的接口
    },
    handleCurrentChange(val) {
      this.currentPage = val
      this.loadTableData()
    },
 
loadTableData() {
      orderList({
        pageNo: this.currentPage,
        pageSize: this.pageSize,
        orderBy: 'update_time',
        descending: true, // true 倒叙
        map: {
          search: this.searchinfo.trim()
        }
      }).then((res) => {
        // console.log(res)
        if (res.status === 200) {
          this.tableData = res.data
          this.totalCount = res.fsp.recordCount
        } else {
          this.$message.error(res.msg)
        }
      })
    },
posted @ 2021-10-29 17:33  小小小小小前端  阅读(175)  评论(0编辑  收藏  举报