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

Locale: compatible vue-i18n, fixed #973
pull/1100/head
SkyAo 2016-11-16 14:34:03 +08:00 committed by GitHub
commit b20995fced
1 changed files with 4 additions and 1 deletions

View File

@ -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]);
}