elementui分页---最后更新

<!--分页-->
    <div class="pagingDive">
      <div class="block">
        <el-pagination
          background
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :current-page="currentPage1"
          :page-size="pageSize"
          layout="total, prev, pager, next"
          :total="total"
        >
        </el-pagination>
      </div>
  </div>
// 分页绑定
currentPage1: 1,//绑在分页上当前页
total: 0,//总数
pageSize: 10,//一页显示多少条
pageNum: 1,//当前页传给后端
//分页 改变时
handleSizeChange(val) {
      this.pageSize = val;
      this.getList();//刷新数据
 },
//分页 条目改变时
handleCurrentChange(val) {
      this.pageNum = val;
      this.getList();//刷新数据
 },
getList() {
      const req = {
        id: "",
        name: this.selectVal,
        account: "",
        phoneNumber: "",
        page: this.pageNum,//传给后端
        limit: this.pageSize //传给后端
      };
      adminUserShow(req).then(res => {
        if (res.data.code == "200") {
          this.cardManagementVal = res.data.data.rows;//把数据绑定在表格上
          this.total = res.data.data.count;//数据的总数量
        } else {
          return false;
        }
      });
    },
posted @ 2020-01-15 14:11  写手在作画  阅读(254)  评论(0编辑  收藏  举报