Browse Source

Merge pull request #1095 from QingWei-Li/fix/default-locale

Locale: compatible vue-i18n, fixed #973
SkyAo 8 years ago
parent
commit
b20995fced
1 changed files with 4 additions and 1 deletions
  1. 4 1
      src/locale/index.js

+ 4 - 1
src/locale/index.js

@@ -12,7 +12,10 @@ export const t = function(path, options) {
   if (typeof vuei18n === 'function') {
     if (!merged) {
       merged = true;
-      Vue.locale(Vue.config.lang, deepmerge(lang, Vue.locale(Vue.config.lang), { clone: true }));
+      Vue.locale(
+        Vue.config.lang,
+        deepmerge(lang, Vue.locale(Vue.config.lang) || {}, { clone: true })
+      );
     }
     return vuei18n.apply(this, [path, options]);
   }