feature:add i18n

This commit is contained in:
Pan
2017-11-03 18:37:49 +08:00
parent bb1d939a94
commit e05da2650b
16 changed files with 381 additions and 55 deletions

View File

@@ -1,6 +1,7 @@
import Vue from 'vue'
import Element from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import i18n from './lang' // 国际化
import App from './App'
import router from './router'
import store from './store'
@@ -10,7 +11,9 @@ import './errorLog'// error log
import './permission' // 权限
import './mock' // 该项目所有请求使用mockjs模拟
Vue.use(Element)
Vue.use(Element, {
i18n: (key, value) => i18n.t(key, value)
})
// register global utility filters.
Object.keys(filters).forEach(key => {
@@ -23,6 +26,7 @@ new Vue({
el: '#app',
router,
store,
i18n,
template: '<App/>',
components: { App }
})