全局重置 table 的 pageSizeOptions

场景:

用户数据量较大,默认的分页不适合,需要实现重置

思路:

Table 组件 pagination 与 Pagination 的是一致的

方案:

根目录 src/app.tsx

import { configure } from 'choerodon-ui';
import { IHzeroConfig } from 'hzero-front/lib/typings/IHzeroConfig';

// 在这个文件内可以重新 c7nUi 配置
const initC7nUiConfig = () => {
  return [
    require('hzero-front/lib/utils/c7nUiConfig'),
    configure({
      // 全局重置 table 的 pageSizeOptions
      pagination: {
        pageSizeOptions: [ '10', '20', '50'],
      },
    }),
  ];
};

const configureParams = () => ({
  // 默认UED主题
  defaultTheme: 'theme1',
});

export default {
  initC7nUiConfig,
  configureParams,
} as IHzeroConfig;

.

posted @ 2022-07-22 17:05  每天都要进步一点点  阅读(322)  评论(0)    收藏  举报