react antd5 分页英文,设置中文

DL-CODER / 2023-07-28 / 原文

使用 ConfigProvider 包裹住英文组件,或者包裹根目录

import { ConfigProvider } from 'antd';
import zhCN from 'antd/locale/zh_CN';

<ConfigProvider locale={zhCN}>
  <Pagination
    total={85}
    showSizeChanger
    showQuickJumper
    showTotal={(total) => `共 ${total} 条`}
  />
</ConfigProvider>
  • antd 传送门:https://ant.design/components/config-provider-cn