import Vue from 'vue';
import App from './App';
import router from './router';
import store from './store';
import ElementUI from 'element-ui';
import http from './plugins/http';
import dataExport from '@/plugins/dataExport';
import SortableHeader from '@/components/SortableHeader';
import MultiUpload from '@/components/MultiUpload';
import SingleUpload from '@/components/SingleUpload';
import FileUpload from '@/components/FileUpload';
import RichText from '@/components/RichText';
import CropUpload from '@/components/CropUpload';
import Formatters from '@/mixins/formatters';
import 'normalize.css/normalize.css';
import 'element-ui/lib/theme-chalk/index.css';

// import VueAMap from "vue-amap";
// Vue.use(VueAMap);
// VueAMap.initAMapApiLoader({
//     key: "bf91055058a47a7dc387e40ab6256a5f",
//     plugin: [
//         "Autocomplete",
//         "PlaceSearch",
//         "Scale",
//         "OverView",
//         "ToolBar",
//         "MapType",
//         "PolyEditor",
//         "AMap.CircleEditor",
//         "AMap.Geolocation",
//     ],
//     uiVersion: "1.0.11",
//     v: "1.4.4",
// });

Vue.config.productionTip = false;
Vue.use(ElementUI, { size: 'small' });
Vue.use(http);
Vue.use(dataExport);
Vue.component('sortable-header', SortableHeader);
Vue.component('multi-upload', MultiUpload);
Vue.component('single-upload', SingleUpload);
Vue.component('file-upload', FileUpload);
Vue.component('rich-text', RichText);
Vue.component('crop-upload', CropUpload);
Vue.mixin(Formatters);

Vue.filter('text', function(value) {
    var span = document.createElement('span');
    span.innerHTML = value;
    return (span.textContent || span.innerText).trim();
});

new Vue({
    router,
    store,
    render: h => h(App)
}).$mount('#app');
