vben-admin分页

  // support xxx.xxx.xxx
    fetchSetting: {
      // The field name of the current page passed to the background
      pageField: 'page',
      // The number field name of each page displayed in the background
      sizeField: 'totalSize',
      // Field name of the form data returned by the interface
      listField: 'items',
      // Total number of tables returned by the interface field name
      totalField: 'totalSize',
    },
    // Number of pages that can be selected
    pageSizeOptions: ['10', '50', '80', '100'],
    // Default display quantity on one page
    defaultPageSize: 10,
    // Default Size
    defaultSize: 'middle',


 const [registerTable, { reload, getPaginationRef }] = useTable({
        title: '租户列表',
        api: getTenantDatac,
        columns: getTenantColumns(),
        beforeFetch(params) {
           var currentPageInfo: any = getPaginationRef();
            params.pageOffset =
              currentPageInfo.current * currentPageInfo.pageSize - currentPageInfo.pageSize;
              console.log('params', getPaginationRef());
            return params;
        },
        isTreeTable: true,
        striped: false,

 

posted @ 2022-03-04 09:43  zjxgdq  阅读(1241)  评论(0编辑  收藏  举报