import Vue from "vue";

import Cookies from "js-cookie";

import "normalize.css/normalize.css";

import Element from "element-ui";

// 图片选择器
// import VueSelectImage from 'vue-select-image'
// import "vue-select-image/dist/vue-select-image.css";
// Vue.use(VueSelectImage) 

// 数据字典
import dict from "./components/Dict";
import Editor from "@/components/Editor";

// 权限指令
import checkPer from "@/utils/permission";
import permission from "./components/Permission";
import "./assets/styles/element-variables.scss";

// global css
import "./assets/styles/index.scss";
import "./assets/styles/util.scss";

import App from "./App";
import store from "./store";
import router from "./router/routers";

import "./assets/icons"; // icon
import "./router/index"; // permission control

// 全局引入
import EleUploadImage from "vue-ele-upload-image";
import VueAMap from "vue-amap";

import VueClipboard from "vue-clipboard2";

import { isPcBowser } from "@/utils/index";

Vue.component(EleUploadImage.name, EleUploadImage);
Vue.component("Editor", Editor);

Vue.use(checkPer);
Vue.use(permission);
Vue.use(dict);
Vue.use(Element, {
  size: Cookies.get("size") || "small" // set element-ui default size
});
Vue.use(VueAMap);
Vue.use(VueClipboard);

Vue.prototype.isPcBowser = isPcBowser();

VueAMap.initAMapApiLoader({
  key: "6033c97e67bf2e9ceac306e1a3fa35f8",
  // securityJsCode: '0547b69252ef0ed14e11f5c4ac152f07',
  plugin: [
    "AMap.Autocomplete",
    "AMap.PlaceSearch",
    "AMap.Scale",
    "AMap.OverView",
    "AMap.ToolBar",
    "AMap.MapType",
    "AMap.PolyEditor",
    "AMap.CircleEditor"
  ]
});

Vue.config.productionTip = false;

new Vue({
  el: "#app",
  router,
  store,
  render: h => h(App)
});
