main.js 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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 router from './router'
  6. import Elementui from 'element-ui'
  7. import store from './store/index.js';
  8. import axios from 'axios'
  9. Vue.prototype.$axios = axios //全局注册,使用方法为:this.$axios
  10. import VueAMap from 'vue-amap';
  11. import {get, post, postJson} from './api/http'
  12. import Tool from './api/tool'
  13. Vue.prototype.$tool = Tool;
  14. Vue.config.productionTip = false
  15. Vue.prototype.$get = get;
  16. Vue.prototype.$post = post;
  17. Vue.prototype.$postJson = postJson;
  18. Vue.use(VueAMap);
  19. Vue.use(Elementui)
  20. VueAMap.initAMapApiLoader({
  21. key: '610161977d2e2632eb34aff3e88a079f',
  22. plugin: ['AMap.Scale','AMap.OverView','AMap.ToolBar','AMap.MapType','AMap.PlaceSearch','AMap.Geolocation','AMap.Geocoder'],
  23. v: '1.4.4',
  24. uiVersion: '1.0'
  25. })
  26. /* eslint-disable no-new */
  27. new Vue({
  28. el: '#app',
  29. router,
  30. store,
  31. components: { App },
  32. template: '<App/>'
  33. })