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-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";
|
|
|
|
// 导入公共样式
|
|
|
|
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]);
|
|
|
|
});
|
|
|
|
|
|
|
|
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");
|
|
|
|
});
|