antd5 日期组件英文状态,如何解决?
为什么按照官网引入了,还是不好使呢?
引入的少了,引入 'dayjs/locale/zh-cn'
import { ConfigProvider } from 'antd';
import zhCN from 'antd/locale/zh_CN';
import 'dayjs/locale/zh-cn';
<Provider store={store}>
<PersistGate loading={null} persistor={persistor}>
<ThemeProvider theme={theme}>
<LayoutWrapper>
<ConfigProvider locale={zhCN}>
<Layout className='layout flex-row'>
<AppMenu />
<Layout className='layout-container'>
<Header className="layout-container-header">
<AppHeader />
</Header>
<Suspense fallback={<AppHeader />}>
<Content className="layout-container-content">
{children}
</Content>
</Suspense>
</Layout>
</Layout>
</ConfigProvider>
</LayoutWrapper>
</ThemeProvider>
</PersistGate>
</Provider>
参考:https://ant.design/docs/react/faq-cn#为什么时间类组件的国际化-locale-设置不生效