-
Notifications
You must be signed in to change notification settings - Fork 14.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
i18n: update doc about vue-i18n@6.x #4471
Conversation
examples/docs/en-US/i18n.md
Outdated
@@ -72,6 +72,42 @@ Vue.use(Element, { | |||
}) | |||
``` | |||
|
|||
## Compatibility `vue-i18n@6.x` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
和上面保持一致吧,Compatible with
How do I configure eui components language when I importing Element on demand and vue-i18n@6.x. It doesn't seem to mention in the document? |
import Vue from 'vue'
import Element from 'element-ui'
import VueI18n from 'vue-i18n'
import enLocale from 'element-ui/lib/locale/lang/en'
import zhLocale from 'element-ui/lib/locale/lang/zh-CN'
import App from './App.vue'
import localeProvider from 'element-ui/lib/locale'
Vue.use(VueI18n)
const messages = {
en: {
message: 'hello',
...enLocale // 或者用 Object.assign({ message: 'hello' }, enLocale)
},
zh: {
message: '你好',
...zhLocale // 或者用 Object.assign({ message: '你好' }, zhLocale)
}
}
// Create VueI18n instance with options
const i18n = new VueI18n({
locale: 'en', // set locale
messages, // set locale messages
})
localeProvider.i18n(key => i18n.t(key))
Vue.use(Element.DatePicker)
new Vue({ i18n, render: h => h(App) }).$mount('#app') |
@QingWei-Li 谢谢! |
这里必须需要进行format处理吧,有的key是 |
* commit '3c590edbab561819ec78b842d38ddf9a27cd733f': (35 commits) [release] 1.3.0-beta.1 [build] 1.3.0-beta.1 update docs vue version Changelog: update for 1.3.0-beta.1 Transfer (ElemeFE#4337) Table: add summary row, fixed ElemeFE#1307, fixed ElemeFE#4451 (ElemeFE#4484) Update date.vue Update date.vue DatePicker: 当format不包括秒时,时间下拉菜单不展示ss update dependencies Radio: fix radio-button style when nested in a form-item DatePicker: make type responsive(ElemeFE#4417) Transition: update docs doc: add DatePicker default-value DatePicker: supports default value i18n: update doc about vue-i18n@6.x (ElemeFE#4471) support use transitiongroup in el-col (ElemeFE#4483) Switch:feat support number value Switch: feature add-expand-value fix upload can't select the same file ... # Conflicts: # CHANGELOG.zh-CN.md # README.md # build/bin/version.js # build/deploy-ci.sh # examples/docs/zh-CN/dialog.md # examples/docs/zh-CN/upload.md # examples/versions.json # package.json # packages/date-picker/src/basic/time-spinner.vue # packages/date-picker/src/panel/date.vue # packages/dialog/src/component.vue # packages/upload/src/index.vue # packages/upload/src/upload.vue # src/index.js
Please makes sure these boxes are checked before submitting your PR, thank you!
dev
branch.