From 0ae5d7a324704d32781de5aa25575bbc29c67dde Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Sat, 27 Nov 2021 10:41:35 +0800 Subject: [PATCH] doc: udpate i18n doc --- site/src/vueDocs/i18n.en-US.md | 6 ++++++ site/src/vueDocs/i18n.zh-CN.md | 8 +++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/site/src/vueDocs/i18n.en-US.md b/site/src/vueDocs/i18n.en-US.md index 859ba1bbc..fddf0c324 100644 --- a/site/src/vueDocs/i18n.en-US.md +++ b/site/src/vueDocs/i18n.en-US.md @@ -6,6 +6,8 @@ The default language is English as of yet. If you want to use other languages, y ant-design-vue provides a Vue Component [ConfigProvider](/components/config-provider) for configuring ant-design-vue locale text globally. +ConfigProvider does not include the internationalization of time components. You need to additionally import the internationalization files of the time library (dayjs, momentjs, date-fns, etc.). Below we have taken dayjs as an example. + ```html <template> <a-config-provider :locale="locale"> @@ -15,6 +17,10 @@ ant-design-vue provides a Vue Component [ConfigProvider](/components/config-prov <script> import zhCN from 'ant-design-vue/es/locale/zh_CN'; + import dayjs from 'dayjs'; + import 'dayjs/locale/zh-cn'; + dayjs.locale('zh-cn'); + export default { data() { return { diff --git a/site/src/vueDocs/i18n.zh-CN.md b/site/src/vueDocs/i18n.zh-CN.md index aac3329c3..86d84bcbd 100644 --- a/site/src/vueDocs/i18n.zh-CN.md +++ b/site/src/vueDocs/i18n.zh-CN.md @@ -2,9 +2,11 @@ `ant-design-vue` 目前的默认文案是英文,如果需要使用其他语言,可以参考下面的方案。 +## + ## ConfigProvider -ant-design-vue 提供了一个 Vue 组件 [ConfigProvider](/components/config-provider-cn) 用于全局配置国际化文案。 +ant-design-vue 提供了一个 Vue 组件 [ConfigProvider](/components/config-provider-cn) 用于全局配置国际化文案。 ConfigProvider 不包含时间类组件的国际化,你需要额外引入时间库(dayjs、momentjs、date-fns 等)的国际化文件,以下我们已 dayjs 为例。 ```html <template> @@ -15,6 +17,10 @@ ant-design-vue 提供了一个 Vue 组件 [ConfigProvider](/components/config-pr <script> import zhCN from 'ant-design-vue/es/locale/zh_CN'; + import dayjs from 'dayjs'; + import 'dayjs/locale/zh-cn'; + dayjs.locale('zh-cn'); + export default { data() { return {