forked from ShengRang/nust-gpa-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
41 lines (34 loc) · 916 Bytes
/
main.js
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
40
import Vue from 'vue'
import VueAwesomeSwiper from 'vue-awesome-swiper'
import App from './App.vue'
Vue.use(require('vue-resource'))
Vue.use(VueAwesomeSwiper)
if (process.env.NODE_ENV === 'production') {
Vue.config.silent = true
Vue.config.devtools = false
Vue.http.options.root = require('./config').APIRoot
} else {
Vue.http.options.root = 'http://localhost:8888'
}
require('./css/page.css')
require('swiper/dist/css/swiper.css')
require('./assets/favicon.ico')
import router from './router'
import store from './store'
store.commit('syncRouter', router) // 把router同步到vuex中
Vue.filter('converter', function (value, before, after) {
if(value == before)
return after
return value
})
new Vue({
router,
store,
el: '#main',
render: h => h(App)
})
require('./js/page.js')
if (process.env.NODE_ENV === 'production'){
// 生产环境引入百度统计
require('./js/hm.js')
}