import { createApp } from "vue";
import App from "./App.vue";
import "default-passive-events";
// reset style sheet
import "@/styles/reset.scss";
// iosn icon
import "@/assets/fonto/iconfont.css";
// svg icons
import "virtual:svg-icons-register";
// iconfont css
import "@/assets/iconfont/iconfont.scss";

//引入Element plus样式
import "element-plus/dist/index.css";
// 引入epic-designer样式
import "epic-designer/dist/style.css";
//注册驻足
import { setupElementPlus } from "@/components/EpicDesigner/ui";
setupElementPlus();
//公共样式
import "@/styles/common.scss";
// 重置 element 样式
import "@/styles/element.scss";
import "@/styles/edesigner/index.css";

// custom directives
import directives from "@/directives/index";
// vue Router
import router from "@/routers";

import * as ElementPlusIconsVue from "@element-plus/icons-vue";
// 导入 tsx 组件
import SvgIcon from "@/components/SvgIcon";
// pinia store
import pinia from "@/stores";
// errorHandler
import errorHandler from "@/utils/errorHandler";

import VXETable from "vxe-table";

localStorage.setItem("baseUrl", import.meta.env.VITE_SINGLE_URL);

const app = createApp(App);
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component);
}
app.config.errorHandler = errorHandler;
app.component("SvgIcon", SvgIcon); // 注册后，所有组件可直接用 <svg-icon>
app.use(directives).use(router).use(pinia).use(VXETable).mount("#app");
