import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import "@vant/touch-emulator";
import "./styles/index.scss";
import qs from 'qs';
Vue.prototype.$qs = qs;
import request from "./utils/request";
import preventClick from "./utils/clickStatefrom";
import "./assets/iconfont/iconfont.css";
import "@/components";
Vue.use(preventClick);
import ElDialog from "element-ui/lib/dialog";
import "element-ui/lib/theme-chalk/dialog.css";
import ElButton from "element-ui/lib/button";
import "element-ui/lib/theme-chalk/button.css";
import ElInput from "element-ui/lib/input";
import "element-ui/lib/theme-chalk/input.css";
import ElForm from "element-ui/lib/form";
import "element-ui/lib/theme-chalk/form.css";
import ElFormItem from "element-ui/lib/form-item";
import "element-ui/lib/theme-chalk/form-item.css";
import ElRow from "element-ui/lib/row";
import "element-ui/lib/theme-chalk/row.css";
import ElCol from "element-ui/lib/col";
import "element-ui/lib/theme-chalk/col.css";
import ElSelect from "element-ui/lib/select";
import "element-ui/lib/theme-chalk/select.css";
import ElOption from "element-ui/lib/option";
import "element-ui/lib/theme-chalk/option.css";
import ElCollapse from "element-ui/lib/collapse";
import "element-ui/lib/theme-chalk/collapse.css";
import ElCollapseItem from "element-ui/lib/collapse-item";
import "element-ui/lib/theme-chalk/collapse-item.css";
import ElImage from "element-ui/lib/image";
import "element-ui/lib/theme-chalk/image.css";
Vue.component("el-dialog", ElDialog);
Vue.component("el-button", ElButton);
Vue.component("el-select", ElSelect);
Vue.component("el-option", ElOption);
Vue.component("el-input", ElInput);
Vue.component("el-form", ElForm);
Vue.component("el-form-item", ElFormItem);
Vue.component("el-row", ElRow);
Vue.component("el-col", ElCol);
Vue.component('el-collapse', ElCollapse);
Vue.component('el-collapse-item', ElCollapseItem);
Vue.component('el-image', ElImage);
// 引入并初始化 vConsole（仅在非生产环境启用，避免线上暴露调试工具）
if (process.env.NODE_ENV !== 'production' && process.env.NODE_ENV !== 'development') {
  const VConsole = require('vconsole')
  new VConsole() // 初始化后，移动端页面会出现 vConsole 悬浮按钮
}
import {
  Swipe,
  SwipeItem,
  Col,
  Row,
  Form,
  Field,
  Button,
  Toast,
  PullRefresh,
  Loading,
  RadioGroup,
  Radio,
  NavBar,
  Icon,
  Popup,
  Dialog,
  NoticeBar,
  Tab,
  Tabs,
  List,
  Cell,
  CellGroup,
  Grid,
  GridItem,
  Image,
  Uploader,
  Empty,
  Checkbox,
  CheckboxGroup,
  ActionSheet,
  Search,
  Overlay,
  Lazyload
} from "vant";

[
  request,
  Swipe,
  SwipeItem,
  Col,
  Row,
  Form,
  Field,
  Button,
  Toast,
  PullRefresh,
  Loading,
  NavBar,
  RadioGroup,
  Radio,
  Icon,
  ElDialog,
  Popup,
  Dialog,
  NoticeBar,
  Tab,
  Tabs,
  List,
  Cell,
  CellGroup,
  Grid,
  GridItem,
  Image,
  Uploader,
  Empty,
  Checkbox,
  CheckboxGroup,
  ActionSheet,
  Search,
  Overlay,
  Lazyload
].forEach(x => Vue.use(x));

Vue.config.productionTip = false;
Vue.prototype.$title = process.env.VUE_APP_PublicTitle;
new Vue({
  router,
  store,
  render: h => h(App)
}).$mount("#app");
