Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
Element
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
林焕东
Element
Commits
7d3bbc8a
Commit
7d3bbc8a
authored
Dec 29, 2016
by
qingwei.li
Committed by
杨奕
Dec 29, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Doc: update docs about vue-i18n, close #2039
parent
cf028a42
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
0 deletions
+39
-0
examples/docs/en-US/i18n.md
examples/docs/en-US/i18n.md
+20
-0
examples/docs/zh-CN/i18n.md
examples/docs/zh-CN/i18n.md
+19
-0
No files found.
examples/docs/en-US/i18n.md
View file @
7d3bbc8a
...
...
@@ -37,6 +37,26 @@ webpack.config.js
}
```
## Compatible with `vue-i18n`
Element is compatible with
[
vue-i18n
](
https://github.com/kazupon/vue-i18n
)
, which makes multilingual switching even easier.
```
javascript
import
Vue
from
'
vue
'
import
VueI18n
from
'
vue-i18n
'
import
Element
from
'
element-ui
'
import
enLocale
from
'
element-ui/lib/locale/lang/en
'
import
zhLocale
from
'
element-ui/lib/locale/lang/zh-CN
'
Vue
.
use
(
VueI18n
)
Vue
.
use
(
Element
)
Vue
.
config
.
lang
=
'
zh-cn
'
Vue
.
locale
(
'
zh-cn
'
,
zhLocale
)
Vue
.
locale
(
'
en
'
,
enLocale
)
```
Currently Element ships with the following languages:
<ul
class=
"language-list"
>
<li>
Simplified Chinese (zh-CN)
</li>
...
...
examples/docs/zh-CN/i18n.md
View file @
7d3bbc8a
...
...
@@ -49,6 +49,25 @@ Vue.component(Select.name, Select)
}
```
## 兼容 `vue-i18n`
Element 兼容
[
vue-i18n
](
https://github.com/kazupon/vue-i18n
)
,搭配使用能更方便地实现多语言切换。
```
javascript
import
Vue
from
'
vue
'
import
VueI18n
from
'
vue-i18n
'
import
Element
from
'
element-ui
'
import
enLocale
from
'
element-ui/lib/locale/lang/en
'
import
zhLocale
from
'
element-ui/lib/locale/lang/zh-CN
'
Vue
.
use
(
VueI18n
)
Vue
.
use
(
Element
)
Vue
.
config
.
lang
=
'
zh-cn
'
Vue
.
locale
(
'
zh-cn
'
,
zhLocale
)
Vue
.
locale
(
'
en
'
,
enLocale
)
```
目前 Element 内置了以下语言:
<ul
class=
"language-list"
>
<li>
简体中文(zh-CN)
</li>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment