// 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 ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import VueAMap from 'vue-amap'
import Cookies from 'vue-cookie'
import './style/main.css'
import router from './router'
import Ajax from './util/ajax'
import api from './util/api'
import toolClass from './util/util'
import store from './store'
import Vuex from 'vuex'
import md5 from 'js-md5'
import VueQuillEditor from 'vue-quill-editor'
// require styles 引入样式
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'

const Base64 = require('js-base64').Base64
Vue.use(ElementUI)
Vue.use(Cookies)
Vue.use(VueAMap)
Vue.use(Vuex)
Vue.use(VueQuillEditor)

VueAMap.initAMapApiLoader({
  key: 'f0d1d4f82432504003ebf46e5e36ff03',
  plugin: ['AMap.Autocomplete', 'AMap.PlaceSearch', 'AMap.Scale', 'AMap.OverView', 'AMap.ToolBar', 'AMap.MapType', 'AMap.PolyEditor', 'AMap.CircleEditor'],
  // 默认高德 sdk 版本为 1.4.4
  v: '1.4.4'
})

Vue.config.productionTip = false
Vue.prototype.$api = api
Vue.prototype.$ajax = Ajax
Vue.prototype.md5 = md5
Vue.prototype.Base64 = Base64
Vue.prototype.toolClass = toolClass
/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  components: { App },
  template: '<App/>'
})
