Skip to content

Commit 11a0c10

Browse files
committed
tweak docs
1 parent 1e5b63b commit 11a0c10

File tree

1 file changed

+30
-5
lines changed

1 file changed

+30
-5
lines changed

docs/guide/migration/vue2.md

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ It can be used in Vue 2 applications that you have already built with vue-i18n@v
1010

1111
And, also some features are backported from [email protected]:
1212

13-
- Vue I18n Compostion API, that is powered by `@vue/composition-api` and `vue-demi`
14-
- for Vue 2.6, you need `@vue/composition-api` and `vue-demi`
15-
- for Vue 2.7, you need `vue-demi` only
13+
- Vue I18n Composition API, that is powered by `@vue/composition-api` and `vue-demi`
1614
- Message format syntax, that is powered by `@intlify/message-compiler`
1715

1816
### Installation
@@ -31,13 +29,14 @@ pnpm add vue-i18n-bridge
3129
You must install the below packages before using this library:
3230

3331
- vue-i18n: >= v8.26.1 < v9
34-
- @vue/composition-api: >= v1.2.0 (for Vue 2.6)
32+
- vue-demi: >= v1.3.5
33+
- @vue/composition-api: >= v1.2.0 (if you will use Vue 2.6)
3534

3635
#### CDN
3736

3837
**For Vue 2.7**:
3938

40-
Include `vue-i18n-bridge` after `vue`, `vue-demo` and it will install.
39+
Include `vue-i18n-bridge` after `vue`, `vue-demi` and it will install.
4140

4241
```html
4342
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
@@ -252,6 +251,19 @@ const { createApp } = VueDemi // exported UMD which is named by `VueDemi`
252251
const { createI18n, useI18n } = VueI18nBridge // exported UMD which is named by `VueI18nBridge`
253252

254253
Vue.use(VueI18n, { bridge: true })
254+
255+
const i18n = createI18n({
256+
locale: 'ja',
257+
messages: {
258+
// ...
259+
}
260+
}, VueI18n)
261+
262+
const app = createApp({}, {
263+
// ...
264+
})
265+
app.use(i18n)
266+
app.mount('#app') // Vue app host container element
255267
```
256268

257269
#### For Vue 2.6
@@ -261,6 +273,19 @@ const { createI18n, useI18n } = VueI18nBridge // exported UMD which is named by
261273

262274
Vue.use(VueCompositionAPI)
263275
Vue.use(VueI18n, { bridge: true })
276+
277+
const i18n = createI18n({
278+
locale: 'ja',
279+
messages: {
280+
// ...
281+
}
282+
}, VueI18n)
283+
284+
const app = createApp({}, {
285+
// ...
286+
})
287+
app.use(i18n)
288+
app.mount('#app') // Vue app host container element
264289
```
265290

266291
### Limitations

0 commit comments

Comments
 (0)