ant-design-vue a-table的分页


          //放表格中操作的按钮
          
//data中的数据data() {
    return {
      pagination: {
        total: 0,
        pageSize: 10,//每页中显示10条数据
        showSizeChanger: true,
        pageSizeOptions: ["10", "20", "50", "100"],//每页中显示的数据
        showTotal: total => `共有 ${total} 条数据`,  //分页中显示总的数据
      },

      loading: true,
      // 查询参数
      queryParam: {
        page: 1,//第几页
        size: 10,//每页中显示数据的条数
        hosName: "",
        hosCode: "",
        province: "",
        city: ""
      },
    };
handleTableChange(pagination) {
      this.pagination.current = pagination.current;
      this.pagination.pageSize = pagination.pageSize;
      this.queryParam.page = pagination.current;
      this.queryParam.size = pagination.pageSize;
      this.getTableList();
    },//调用查询接口为dataSource 赋值

    getTableList() {
      this.loading = true;
      retriveHosData(this.queryParam).then(res => {
        if (res.message === "SUCCESS") {
          const pagination = { ...this.pagination };
          pagination.total = res.data.total;
          this.tableDatas = res.data.list;
          this.pagination = pagination;
        }
        this.loading = false;
      });
    },

你可能感兴趣的:(vue)