提交 | 用户 | 时间
|
820397
|
1 |
// 引入unocss css |
H |
2 |
import '@/plugins/unocss' |
|
3 |
|
|
4 |
// 导入全局的svg图标 |
|
5 |
import '@/plugins/svgIcon' |
|
6 |
|
|
7 |
// 初始化多语言 |
|
8 |
import { setupI18n } from '@/plugins/vueI18n' |
|
9 |
|
|
10 |
// 引入状态管理 |
|
11 |
import { setupStore } from '@/store' |
|
12 |
|
|
13 |
// 全局组件 |
|
14 |
import { setupGlobCom } from '@/components' |
|
15 |
|
|
16 |
// 引入 element-plus |
|
17 |
import { setupElementPlus } from '@/plugins/elementPlus' |
|
18 |
|
|
19 |
// 引入 form-create |
|
20 |
import { setupFormCreate } from '@/plugins/formCreate' |
|
21 |
|
|
22 |
// 引入全局样式 |
|
23 |
import '@/styles/index.scss' |
|
24 |
|
|
25 |
// 引入动画 |
|
26 |
import '@/plugins/animate.css' |
|
27 |
|
|
28 |
// 路由 |
|
29 |
import router, { setupRouter } from '@/router' |
|
30 |
|
|
31 |
// 权限 |
|
32 |
import { setupAuth } from '@/directives' |
|
33 |
|
|
34 |
import { createApp } from 'vue' |
|
35 |
|
|
36 |
import App from './App.vue' |
|
37 |
|
|
38 |
import './permission' |
|
39 |
|
|
40 |
import '@/plugins/tongji' // 百度统计 |
|
41 |
import Logger from '@/utils/Logger' |
|
42 |
|
|
43 |
import VueDOMPurifyHTML from 'vue-dompurify-html' // 解决v-html 的安全隐患 |
|
44 |
|
|
45 |
// 创建实例 |
|
46 |
const setupAll = async () => { |
|
47 |
const app = createApp(App) |
|
48 |
|
|
49 |
await setupI18n(app) |
|
50 |
|
|
51 |
setupStore(app) |
|
52 |
|
|
53 |
setupGlobCom(app) |
|
54 |
|
|
55 |
setupElementPlus(app) |
|
56 |
|
|
57 |
setupFormCreate(app) |
|
58 |
|
|
59 |
setupRouter(app) |
|
60 |
|
|
61 |
setupAuth(app) |
|
62 |
|
|
63 |
await router.isReady() |
|
64 |
|
|
65 |
app.use(VueDOMPurifyHTML) |
|
66 |
|
|
67 |
app.mount('#app') |
|
68 |
} |
|
69 |
|
|
70 |
setupAll() |
|
71 |
|
|
72 |
Logger.prettyPrimary(`欢迎使用`, import.meta.env.VITE_APP_TITLE) |