45 lines
1.4 KiB
TypeScript
Raw Normal View History

2021-10-16 16:16:58 +08:00
import App from "./App.vue";
import router from "./router";
import { setupStore } from "/@/store";
import { getServerConfig } from "./config";
import { createApp, Directive } from "vue";
import { usI18n } from "../src/plugins/i18n";
import { MotionPlugin } from "@vueuse/motion";
2021-11-13 14:50:58 +08:00
import { useFontawesome } from "../src/plugins/fontawesome";
2021-10-16 16:16:58 +08:00
import { useElementPlus } from "../src/plugins/element-plus";
import { injectResponsiveStorage } from "/@/utils/storage/responsive";
import "animate.css";
2022-01-07 17:26:05 +08:00
import "virtual:windi.css";
2021-10-16 16:16:58 +08:00
// 导入公共样式
import "./style/index.scss";
// 导入字体图标
import "./assets/iconfont/iconfont.js";
import "./assets/iconfont/iconfont.css";
const app = createApp(App);
// 自定义指令
import * as directives from "/@/directives";
Object.keys(directives).forEach(key => {
app.directive(key, (directives as { [key: string]: Directive })[key]);
});
2022-01-21 11:32:58 +08:00
// 全局注册`@iconify/vue`图标库
import { IconifyIconOffline, IconifyIconOnline } from "./components/ReIcon";
app.component("IconifyIconOffline", IconifyIconOffline);
app.component("IconifyIconOnline", IconifyIconOnline);
2021-10-16 16:16:58 +08:00
getServerConfig(app).then(async config => {
injectResponsiveStorage(app, config);
setupStore(app);
2021-11-13 14:50:58 +08:00
app
.use(router)
.use(MotionPlugin)
.use(useElementPlus)
.use(usI18n)
.use(useFontawesome);
2021-10-16 16:16:58 +08:00
await router.isReady();
app.mount("#app");
});