main.js 1.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // The Vue build version to load with the `import` command
  2. // (runtime-only or standalone) has been set in webpack.base.conf with an alias.
  3. import Vue from 'vue'
  4. import App from './App'
  5. import ElementUI from 'element-ui'
  6. import 'element-ui/lib/theme-chalk/index.css'
  7. import VueAMap from 'vue-amap'
  8. import Cookies from 'vue-cookie'
  9. import './style/main.css'
  10. import router from './router'
  11. import Ajax from './util/ajax'
  12. import api from './util/api'
  13. import toolClass from './util/util'
  14. import store from './store'
  15. import Vuex from 'vuex'
  16. import md5 from 'js-md5'
  17. const Base64 = require('js-base64').Base64
  18. Vue.use(ElementUI)
  19. Vue.use(Cookies)
  20. Vue.use(VueAMap)
  21. Vue.use(Vuex)
  22. VueAMap.initAMapApiLoader({
  23. key: 'f0d1d4f82432504003ebf46e5e36ff03',
  24. plugin: ['AMap.Autocomplete', 'AMap.PlaceSearch', 'AMap.Scale', 'AMap.OverView', 'AMap.ToolBar', 'AMap.MapType', 'AMap.PolyEditor', 'AMap.CircleEditor'],
  25. // 默认高德 sdk 版本为 1.4.4
  26. v: '1.4.4'
  27. })
  28. Vue.config.productionTip = false
  29. Vue.prototype.$api = api
  30. Vue.prototype.$ajax = Ajax
  31. Vue.prototype.md5 = md5
  32. Vue.prototype.Base64 = Base64
  33. Vue.prototype.toolClass = toolClass
  34. /* eslint-disable no-new */
  35. new Vue({
  36. el: '#app',
  37. router,
  38. store,
  39. components: { App },
  40. template: '<App/>'
  41. })