import { createApp } from "vue";
import App from "./App.vue";
import router from "@/router";
import { setupStore } from "@/store";
import { setupDirective } from "@/directive";

import "@/permission";

// 本地SVG图标
import "virtual:svg-icons-register";

// 国际化
import i18n from "@/lang/index";

// 样式
import "element-plus/theme-chalk/dark/css-vars.css";
import "@/styles/index.scss";
import "uno.css";
import 'amfe-flexible'
import "@/styles/my.scss"; // 引入自己定义的样式
// 引入组件
import myLoading from "@/components/myLoading.vue";
import myLoadingIcon from "@/components/myLoadingIcon.vue";


const app = createApp(App);
// 全局注册 自定义指令(directive)
setupDirective(app);
// 全局注册 状态管理(store)
setupStore(app);
// element
import ElementPlus from "element-plus";

app.use(ElementPlus);

app.use(router).use(i18n).mount("#app");
// 路由加载完成后挂载
// router.isReady().then(() => {
//   app.use(router).use(i18n).use(store).mount('#app')
// });
// 注册全局组件
app.component('myLoading',myLoading).component('myLoadingIcon',myLoadingIcon)