44 lines
1.2 KiB
JavaScript
44 lines
1.2 KiB
JavaScript
|
// The Vue build version to load with the `import` command
|
||
|
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
|
||
|
import Vue from 'vue'
|
||
|
import App from './App'
|
||
|
import router from './router'
|
||
|
import BaiduMap from 'vue-baidu-map'
|
||
|
import VueWechatTitle from 'vue-wechat-title'
|
||
|
import VueAwesomeSwiper from 'vue-awesome-swiper'
|
||
|
import VueResource from 'vue-resource'
|
||
|
import layer from 'vue-layer'
|
||
|
import 'styles/reset.css'
|
||
|
import 'swiper/dist/css/swiper.css'
|
||
|
import 'vue-layer/lib/vue-layer.css'
|
||
|
import axios from 'axios'
|
||
|
import flvjs from 'flv.js'
|
||
|
Vue.use(flvjs)
|
||
|
axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded'
|
||
|
Vue.prototype.$axios = axios
|
||
|
Vue.use(layer)
|
||
|
Vue.prototype.$layer = layer(Vue)
|
||
|
Vue.use(VueResource)
|
||
|
Vue.use(VueAwesomeSwiper)
|
||
|
Vue.use(VueWechatTitle)
|
||
|
Vue.use(BaiduMap, {
|
||
|
ak: 'OMpRxEIx1s7uMebZM9R09V4bv5zapeIm'
|
||
|
})
|
||
|
Vue.config.productionTip = false
|
||
|
|
||
|
/* eslint-disable no-new */
|
||
|
new Vue({
|
||
|
el: '#app',
|
||
|
router,
|
||
|
components: { App },
|
||
|
template: '<App/>'
|
||
|
})
|
||
|
|
||
|
router.beforeEach((to, from, next) => {
|
||
|
/* 路由发生变化修改页面title */
|
||
|
if (to.meta.title) {
|
||
|
document.title = to.meta.title
|
||
|
}
|
||
|
next()
|
||
|
})
|