2022-08-26 10:35:25 +08:00
|
|
|
import { createApp } from "vue"
|
|
|
|
import type { Directive } from "vue"
|
2022-07-04 16:15:16 +08:00
|
|
|
import store from "./store"
|
2022-04-22 01:16:02 +08:00
|
|
|
import router from "./router"
|
2022-04-22 12:47:04 +08:00
|
|
|
import "@/router/permission"
|
|
|
|
import App from "./App.vue"
|
2022-05-05 17:18:58 +08:00
|
|
|
import ElementPlus from "element-plus"
|
2022-04-22 01:16:02 +08:00
|
|
|
import loadSvg from "@/icons"
|
2022-05-05 17:18:58 +08:00
|
|
|
import * as directives from "@/directives"
|
2022-09-30 17:41:47 +08:00
|
|
|
import * as ElementPlusIconsVue from "@element-plus/icons-vue"
|
2022-05-12 19:07:54 +08:00
|
|
|
|
|
|
|
import "uno.css"
|
2022-04-22 12:47:04 +08:00
|
|
|
import "normalize.css"
|
2022-05-12 19:07:54 +08:00
|
|
|
import "element-plus/dist/index.css"
|
|
|
|
import "element-plus/theme-chalk/dark/css-vars.css"
|
|
|
|
import "@/styles/index.scss"
|
2022-04-20 22:40:26 +08:00
|
|
|
|
2022-04-21 18:20:39 +08:00
|
|
|
const app = createApp(App)
|
2022-07-01 16:25:51 +08:00
|
|
|
/** Element-Plus 组件完整引入 */
|
2022-05-05 17:18:58 +08:00
|
|
|
app.use(ElementPlus)
|
2022-10-08 15:19:36 +08:00
|
|
|
/** 注册所有 Element-Plus Icon */
|
|
|
|
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
|
|
|
|
app.component(key, component)
|
|
|
|
}
|
2022-07-01 16:25:51 +08:00
|
|
|
/** 加载全局 SVG */
|
2022-04-21 18:20:39 +08:00
|
|
|
loadSvg(app)
|
2022-05-05 17:18:58 +08:00
|
|
|
/** 自定义指令 */
|
2022-04-21 18:20:39 +08:00
|
|
|
Object.keys(directives).forEach((key) => {
|
|
|
|
app.directive(key, (directives as { [key: string]: Directive })[key])
|
|
|
|
})
|
|
|
|
|
2022-04-22 01:16:02 +08:00
|
|
|
app.use(store).use(router).mount("#app")
|