Locale: compatible vue-i18n, fixed #973

pull/1095/head
qingwei.li 2016-11-16 12:06:24 +08:00
parent 0013043ad7
commit 2241e9f2b4
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]);
}