2021-10-16 16:16:58 +08:00
|
|
|
|
import App from "./App.vue";
|
|
|
|
|
import router from "./router";
|
2022-10-27 13:17:56 +08:00
|
|
|
|
import { setupStore } from "@/store";
|
2024-03-09 16:27:52 +08:00
|
|
|
|
import { getPlatformConfig } from "./config";
|
2021-11-10 22:12:47 +08:00
|
|
|
|
import { MotionPlugin } from "@vueuse/motion";
|
2022-10-27 13:17:56 +08:00
|
|
|
|
// import { useEcharts } from "@/plugins/echarts";
|
2024-03-09 16:27:52 +08:00
|
|
|
|
import { createApp, type Directive } from "vue";
|
|
|
|
|
import { useElementPlus } from "@/plugins/elementPlus";
|
2022-10-27 13:17:56 +08:00
|
|
|
|
import { injectResponsiveStorage } from "@/utils/responsive";
|
2024-05-18 01:11:46 +08:00
|
|
|
|
import mitt from "mitt";
|
2022-08-22 21:34:55 +08:00
|
|
|
|
|
2024-03-09 16:27:52 +08:00
|
|
|
|
import Table from "@pureadmin/table";
|
2022-08-22 21:34:55 +08:00
|
|
|
|
// import PureDescriptions from "@pureadmin/descriptions";
|
2021-10-16 16:16:58 +08:00
|
|
|
|
|
2022-05-07 11:50:06 +08:00
|
|
|
|
// 引入重置样式
|
|
|
|
|
import "./style/reset.scss";
|
2021-10-16 16:16:58 +08:00
|
|
|
|
// 导入公共样式
|
|
|
|
|
import "./style/index.scss";
|
2022-12-19 13:45:28 +08:00
|
|
|
|
// 一定要在main.ts中导入tailwind.css,防止vite每次hmr都会请求src/style/index.scss整体css文件导致热更新慢的问题
|
|
|
|
|
import "./style/tailwind.css";
|
2022-05-07 11:50:06 +08:00
|
|
|
|
import "element-plus/dist/index.css";
|
2021-10-16 16:16:58 +08:00
|
|
|
|
// 导入字体图标
|
|
|
|
|
import "./assets/iconfont/iconfont.js";
|
|
|
|
|
import "./assets/iconfont/iconfont.css";
|
|
|
|
|
|
2024-05-18 01:11:46 +08:00
|
|
|
|
const EventMitt = mitt();
|
2021-10-16 16:16:58 +08:00
|
|
|
|
const app = createApp(App);
|
|
|
|
|
|
|
|
|
|
// 自定义指令
|
2022-10-27 13:17:56 +08:00
|
|
|
|
import * as directives from "@/directives";
|
2021-10-16 16:16:58 +08:00
|
|
|
|
Object.keys(directives).forEach(key => {
|
|
|
|
|
app.directive(key, (directives as { [key: string]: Directive })[key]);
|
|
|
|
|
});
|
|
|
|
|
|
2024-03-09 16:27:52 +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
|
|
|
|
|
2022-10-25 17:51:21 +08:00
|
|
|
|
// 全局注册按钮级别权限组件
|
2022-10-27 13:17:56 +08:00
|
|
|
|
import { Auth } from "@/components/ReAuth";
|
2022-10-25 17:51:21 +08:00
|
|
|
|
app.component("Auth", Auth);
|
|
|
|
|
|
2024-03-09 16:27:52 +08:00
|
|
|
|
// 全局注册vue-tippy
|
|
|
|
|
import "tippy.js/dist/tippy.css";
|
|
|
|
|
import "tippy.js/themes/light.css";
|
|
|
|
|
import VueTippy from "vue-tippy";
|
|
|
|
|
app.use(VueTippy);
|
|
|
|
|
|
2024-05-18 01:11:46 +08:00
|
|
|
|
declare module "vue" {
|
|
|
|
|
export interface ComponentCustomProperties {
|
|
|
|
|
$bus: typeof EventMitt;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
app.config.globalProperties.$bus = EventMitt;
|
|
|
|
|
|
2024-03-09 16:27:52 +08:00
|
|
|
|
getPlatformConfig(app).then(async config => {
|
|
|
|
|
setupStore(app);
|
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);
|
2024-03-09 16:27:52 +08:00
|
|
|
|
app.use(MotionPlugin).use(useElementPlus).use(Table);
|
|
|
|
|
// .use(PureDescriptions)
|
2022-08-22 21:34:55 +08:00
|
|
|
|
// .use(useEcharts);
|
2021-10-16 16:16:58 +08:00
|
|
|
|
app.mount("#app");
|
|
|
|
|
});
|