update export & i18n

This commit is contained in:
梁灏 2017-11-07 16:43:23 +08:00
parent 32e8393a19
commit c7e432f7e3
2 changed files with 76 additions and 4 deletions

View file

@ -1,5 +1,3 @@
// https://github.com/ElemeFE/element/blob/dev/src/locale/index.js
import defaultLang from './lang/zh-CN';
import Vue from 'vue';
import deepmerge from 'deepmerge';
@ -10,7 +8,7 @@ let lang = defaultLang;
let merged = false;
let i18nHandler = function() {
const vuei18n = Object.getPrototypeOf(this || Vue).$t;
if (typeof vuei18n === 'function') {
if (typeof vuei18n === 'function' && !!Vue.locale) {
if (!merged) {
merged = true;
Vue.locale(