/* eslint-disable no-new */
// (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 '@/assets/styles/style.less'
// import '@/assets/styles/style.css'
// import '@/assets/styles/container.less'
import 'vux/src/styles/1px.less'
import 'babel-polyfill'
import store from './store'
import '@/assets/scrollIntoView'

import '@/assets/flexible.js' // 引入rem适配文件
// import 'lib-flexible'

import api from './api/index.js' // 将api挂载到vue的原型上

// 共用js
import common from '@/assets/common.js'

import DomPortal from 'vue-dom-portal'

import { handleResponse } from './assets/utils/util.js'
import { ToastPlugin, ConfirmPlugin, AlertPlugin, DatetimePlugin } from 'vux'
import * as fundebug from 'fundebug-javascript'
import fundebugVue from 'fundebug-vue' // 导入api接口

// import VConsole from 'vconsole'
// new VConsole()

const bus = new Vue() // eventBus 事件总线
Vue.prototype.$EventBus = bus // 将事件总线挂载到vue的原型上

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

Vue.config.productionTip = false
fundebug.init({
    apikey: '73dbb7c6ef317f20be66245e71b7d94499fa29fc9783913190dc30baa0c98882',
    silentDev: true // 开发环境下不监控错误（当 URL 中含有 localhost 或者 IP 时判断为开发环境，否则是生产环境）
})
fundebugVue(fundebug, Vue)

Vue.use(DomPortal)
Vue.config.productionTip = false // ui
Vue.use(ToastPlugin)
Vue.use(ConfirmPlugin)
Vue.use(AlertPlugin)
Vue.use(DatetimePlugin)

new Vue({
    el: '#app',
    components: {
        App
    },
    template: '<App/>',
    router,
    store
}).$mount('#app')
