main.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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.Autocomplete", //输入提示插件
  23. "AMap.PlaceSearch", //POI搜索插件
  24. "AMap.Scale", //右下角缩略图插件 比例尺
  25. "AMap.OverView", //地图鹰眼插件
  26. "AMap.ToolBar", //地图工具条
  27. "AMap.MapType", //类别切换控件,实现默认图层与卫星图、实施交通图层之间切换的控制
  28. "AMap.PolyEditor", //编辑 折线多,边形
  29. "AMap.CircleEditor", //圆形编辑器插件
  30. "AMap.Geolocation" //定位控件,用来获取和展示用户主机所在的经纬度位置
  31. ],
  32. v: '1.4.4',
  33. uiVersion: '1.0'
  34. })
  35. /* eslint-disable no-new */
  36. new Vue({
  37. el: '#app',
  38. router,
  39. store,
  40. components: { App },
  41. template: '<App/>'
  42. })