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";
|
2021-11-10 22:12:47 +08:00
|
|
|
import { MotionPlugin } from "@vueuse/motion";
|
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`图标库
|
2022-02-05 14:45:20 +08:00
|
|
|
import {
|
|
|
|
IconifyIconOffline,
|
|
|
|
IconifyIconOnline,
|
|
|
|
FontIcon
|
|
|
|
} from "./components/ReIcon";
|
2022-01-21 11:32:58 +08:00
|
|
|
app.component("IconifyIconOffline", IconifyIconOffline);
|
|
|
|
app.component("IconifyIconOnline", IconifyIconOnline);
|
2022-02-05 14:45:20 +08:00
|
|
|
app.component("FontIcon", FontIcon);
|
2022-01-21 11:32:58 +08:00
|
|
|
|
2021-10-16 16:16:58 +08:00
|
|
|
getServerConfig(app).then(async config => {
|
2022-03-03 23:30:08 +08:00
|
|
|
app.use(router);
|
|
|
|
await router.isReady();
|
2021-10-16 16:16:58 +08:00
|
|
|
injectResponsiveStorage(app, config);
|
|
|
|
setupStore(app);
|
2022-03-03 23:30:08 +08:00
|
|
|
app.use(MotionPlugin).use(useElementPlus).use(usI18n);
|
2021-10-16 16:16:58 +08:00
|
|
|
app.mount("#app");
|
|
|
|
});
|