1
- import Vue from 'vue'
2
- import App from './App'
1
+ import Vue from 'vue' ;
2
+ import App from './App' ;
3
3
4
- Vue . config . productionTip = false
4
+ Vue . config . productionTip = false ;
5
5
6
- App . mpType = 'app'
6
+ App . mpType = 'app' ;
7
7
8
8
// 此处为演示Vue.prototype使用,非uView的功能部分
9
- Vue . prototype . vuePrototype = '枣红'
9
+ Vue . prototype . vuePrototype = '枣红' ;
10
10
11
11
// 引入全局uView
12
- import uView from 'uview-ui'
13
- Vue . use ( uView )
12
+ import uView from 'uview-ui' ;
13
+ Vue . use ( uView ) ;
14
14
15
15
// 此处为演示vuex使用,非uView的功能部分
16
- import store from '@/store'
16
+ import store from '@/store' ;
17
17
18
18
// 引入uView提供的对vuex的简写法文件
19
- let vuexStore = require ( '@/store/$u.mixin.js' )
20
- Vue . mixin ( vuexStore )
19
+ let vuexStore = require ( '@/store/$u.mixin.js' ) ;
20
+ Vue . mixin ( vuexStore ) ;
21
21
22
22
// 引入uView对小程序分享的mixin封装
23
23
let mpShare = require ( 'uview-ui/libs/mixin/mpShare.js' ) ;
24
- Vue . mixin ( mpShare )
24
+ Vue . mixin ( mpShare ) ;
25
25
26
26
// i18n部分的配置
27
27
// 引入语言包,注意路径
28
28
import Chinese from '@/common/locales/zh.js' ;
29
29
import English from '@/common/locales/en.js' ;
30
30
31
31
// VueI18n
32
- import VueI18n from '@/common/vue-i18n.min.js'
32
+ import VueI18n from '@/common/vue-i18n.min.js' ;
33
33
34
34
// VueI18n
35
- Vue . use ( VueI18n )
35
+ Vue . use ( VueI18n ) ;
36
36
37
37
const i18n = new VueI18n ( {
38
38
// 默认语言
@@ -42,23 +42,23 @@ const i18n = new VueI18n({
42
42
'zh' : Chinese ,
43
43
'en' : English ,
44
44
}
45
- } )
45
+ } ) ;
46
46
47
47
// 由于微信小程序的运行机制问题,需声明如下一行,H5和APP非必填
48
- Vue . prototype . _i18n = i18n
48
+ Vue . prototype . _i18n = i18n ;
49
49
50
50
const app = new Vue ( {
51
51
i18n,
52
52
store,
53
53
...App
54
- } )
54
+ } ) ;
55
55
56
56
// http拦截器,将此部分放在new Vue()和app.$mount()之间,才能App.vue中正常使用
57
- import httpInterceptor from '@/common/http.interceptor.js'
58
- Vue . use ( httpInterceptor , app )
57
+ import httpInterceptor from '@/common/http.interceptor.js' ;
58
+ Vue . use ( httpInterceptor , app ) ;
59
59
60
60
// http接口API抽离,免于写url或者一些固定的参数
61
- import httpApi from '@/common/http.api.js'
62
- Vue . use ( httpApi , app )
61
+ import httpApi from '@/common/http.api.js' ;
62
+ Vue . use ( httpApi , app ) ;
63
63
64
- app . $mount ( )
64
+ app . $mount ( ) ;
0 commit comments