-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
66 lines (64 loc) · 1.91 KB
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// 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 router from './router'
import VueAMap from 'vue-amap';
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import axios from 'axios';
import '@/assets/css/iconfont/iconfont.css'
import echarts from 'echarts'
import VueCookies from 'vue-cookies'
import store from './store'
Vue.use(VueCookies);
Vue.prototype.$echarts = echarts;
Vue.use(echarts);
Vue.config.productionTip = false
Vue.use(VueAMap);
Vue.use(ElementUI);
VueAMap.initAMapApiLoader({
key: '8658927f241caadbdfcc764245a1f1ee',
plugin: [
"AMap.Autocomplete", //输入提示插件
"AMap.PlaceSearch", //POI搜索插件
"AMap.Scale", //右下角缩略图插件 比例尺
"AMap.OverView", //地图鹰眼插件
"AMap.ToolBar", //地图工具条
"AMap.MapType", //类别切换控件,实现默认图层与卫星图、实施交通图层之间切换的控制
"AMap.PolyEditor", //编辑 折线多,边形
"AMap.CircleEditor", //圆形编辑器插件
"AMap.Geolocation" ,//定位控件,用来获取和展示用户主机所在的经纬度位置
"AMap.Geocoder"
],
v: '1.4.4'
});
Vue.directive('morecolor',{
bind(el,binding,vnode){
var sum=Math.floor(Math.random()*(-484848)+888888)
el.style.color="#"+sum;
}
});
Vue.prototype.dateFormat= function(date){
// return date.getFullYear()+"-"+date.getMonth()+1+"-"+date.getDate();
return `${date.getFullYear()}-${date.getMonth()+1}-${date.getDate()}`;
}
Vue.filter('hideW', function (value) {
if(value.length>3){
return value.slice(0,3)+".";
}
else{
return value;
}
})
Vue.filter("hideTowords",function(value){
return value.slice(2,10)
})
/* eslint-disable no-new */
new Vue({
el: '#app',
store,
router,
components: { App },
template: '<App/>'
})