doc: udpate i18n doc
parent
be9d448ec9
commit
0ae5d7a324
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue