import { createApp } from "vue";
// 自定义指令
import directives from "./directives";
import "./style.css";
import App from "./App.vue";
import ElementPlus from "element-plus";
import "element-plus/dist/index.css";
import CommonSelector from "@/components/CommonSelector.vue";
import * as ElIcons from "@element-plus/icons";
import zhCn from "element-plus/dist/locale/zh-cn.mjs";
import router from "./router";
import { createPinia } from "pinia";
import "./assets/fonts/font.less"; // 字体样式
import "../public/iconFont/iconfont.css"; // 图标字体样式
import { $get, $post } from "@/data/https.js";
import windowConfig from "@/window";
import moment from "moment";

const pinia = createPinia();
const app = createApp(App);
app.config.globalProperties.$get = $get;
app.config.globalProperties.$post = $post;
app.config.globalProperties.windowConfig = windowConfig;
app.config.globalProperties.moment = moment;
Object.entries(directives).forEach(([directiveName, directive]) => {
  app.directive(directiveName, directive);
});
for (const [key, component] of Object.entries(ElIcons)) {
  app.component(key, component);
}
app.component("CommonSelector", CommonSelector);
app.use(ElementPlus, { locale: zhCn }).use(router).use(pinia).mount("#app");
