// 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.js'
import './assets/styles/reset.css'
import ElementUI from 'element-ui'
import '@/assets/styles/style.less'
import '@/assets/fonts/mobileModuleIcon/iconfont.css'
import 'element-ui/lib/theme-chalk/index.css'
import 'babel-polyfill'
import store from './store'
// import axios from 'axios'
import Print from '@/assets/utils/print.js'
import globalComponents from '@/common/global/index.js'

import api from './api' // 导入api接口
import { handleResponse } from './assets/utils/util.js'

// An escape hatch for DOM Elements in Vue.js components.
// Thanks to:  https://github.com/calebroseland/vue-dom-portal
import DomPortal from 'vue-dom-portal'

import VueCropper from 'vue-cropper'

// fundebug BUG 监控平台
import * as fundebug from 'fundebug-javascript'
import fundebugVue from 'fundebug-vue'
fundebug.init({
    apikey: '73dbb7c6ef317f20be66245e71b7d94499fa29fc9783913190dc30baa0c98882',
    silentDev: true // 开发环境下不监控错误（当 URL 中含有 localhost 或者 IP 时判断为开发环境，否则是生产环境）
})
fundebugVue(fundebug, Vue)

Vue.use(globalComponents)
Vue.use(DomPortal) // 图片裁剪功能
Vue.use(VueCropper)
Vue.use(Print)

Vue.prototype.$api = api // 将api挂载到vue的原型上
Vue.prototype.$handleResponse = handleResponse

Vue.config.productionTip = false
Vue.use(ElementUI, {
    size: 'small',
    zIndex: 3000
})

/* eslint-disable no-new */
new Vue({
    el: '#app',
    router,
    store,
    components: {
        App
    },
    template: '<App/>'
})
