forked from huzhushan/vue3-element-admin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
87 lines (74 loc) · 2.29 KB
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/*
* _oo0oo_
* o8888888o
* 88" . "88
* (| -_- |)
* 0\ = /0
* ___/`---'\___
* .' \\| |// '.
* / \\||| : |||// \
* / _||||| -:- |||||- \
* | | \\\ - /// | |
* | \_| ''\---/'' |_/ |
* \ .-\__ '-' ___/-. /
* ___'. .' /--.--\ `. .'___
* ."" '< `.___\_<|>_/___.' >' "".
* | | : `- \`.;`\ _ /`;.`/ - ` : | |
* \ \ `_. \_ __\ /__ _/ .-` / /
* =====`-.____`.___ \_____/___.-`___.-'=====
* `=---='
*
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*
* 佛祖保佑 永不宕机 永无BUG
*
* @Descripttion:
* @version:
* @Date: 2021-04-20 11:06:21
* @LastEditors: [email protected]
* @LastEditTime: 2022-09-27 19:04:15
* @Author: [email protected]
* @HomePage: https://huzhushan.gitee.io/vue3-element-admin
* @Github: https://github.com/huzhushan/vue3-element-admin
* @Donate: https://huzhushan.gitee.io/vue3-element-admin/donate/
*/
import { createApp } from 'vue'
import App from './App.vue'
const app = createApp(App)
// 引入element-plus
import ElementPlus from 'element-plus'
import './assets/style/element-variables.scss'
// 国际化
import i18n from '@/i18n'
// 全局注册element-plus/icons-vue
import * as ICONS from '@element-plus/icons-vue'
Object.entries(ICONS).forEach(([key, component]) => {
// app.component(key === 'PieChart' ? 'PieChartIcon' : key, component)
app.component(key, component)
})
// 引入路由
import router from './router'
// 引入pinia
import pinia from './pinia'
// 权限控制
import './permission'
// 引入svg图标注册脚本
import 'vite-plugin-svg-icons/register'
// 注册全局组件
import * as Components from './global-components'
Object.entries(Components).forEach(([key, component]) => {
app.component(key, component)
})
// 注册自定义指令
import * as Directives from '@/directive'
Object.values(Directives).forEach(fn => fn(app))
// 错误日志
import useErrorHandler from './error-log'
useErrorHandler(app)
app
.use(i18n)
.use(ElementPlus)
.use(pinia)
.use(router)
.mount('#app')