main.js
881 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import Vue from 'vue';
import VueI18n from 'vue-i18n';
import App from './App.vue';
import router from './router';
import store from './store/index';
import VueAwesomeSwiper from 'vue-awesome-swiper'
// require styles
import 'swiper/dist/css/swiper.css'
Vue.use(VueAwesomeSwiper, /* { default global options } */)
import Mock from './mock'
Mock.bootstrap();
// import 'amfe-flexible';
Vue.config.productionTip = false
Vue.use(VueI18n)
const i18n = new VueI18n({
locale: localStorage.getItem("lang") || 'zh', // 语言标识
//this.$i18n.locale // 通过切换locale的值来实现语言切换
messages: {
'zh': require('@/common/lang/zh'), // 中文语言包
'en': require('@/common/lang/en') // 英文语言包
}
})
new Vue({
i18n,
router,
store,
render: h => h(App),
mounted: () => {
document.dispatchEvent(new Event('render-event'));
}
}).$mount('#app')