diff --git a/examples/ssr/src/app.js b/examples/ssr/src/app.js index 3b4f58e7e..e5368c12d 100644 --- a/examples/ssr/src/app.js +++ b/examples/ssr/src/app.js @@ -2,7 +2,7 @@ import Vue from 'vue' import App from './App.vue' import { createStore } from './store' import { createRouter } from './router' -import i18n from './i18n' +import { createI18n } from './i18n' import { sync } from 'vuex-router-sync' import titleMixin from './util/title' import * as filters from './util/filters' @@ -21,6 +21,7 @@ export function createApp () { // create store and router instances const store = createStore() const router = createRouter() + const i18n = createI18n() // sync the router with the vuex store. // this registers `store.state.route` diff --git a/examples/ssr/src/i18n/index.js b/examples/ssr/src/i18n/index.js index c69dbfe49..100440f61 100644 --- a/examples/ssr/src/i18n/index.js +++ b/examples/ssr/src/i18n/index.js @@ -5,10 +5,12 @@ import jp from './ja-JP.json' Vue.use(VueI18n) -export default new VueI18n({ - locale: 'en-US', - messages: { - 'en-US': en, - 'ja-JP': jp - } -}) +export function createI18n () { + return new VueI18n({ + locale: 'en-US', + messages: { + 'en-US': en, + 'ja-JP': jp + } + }) +}