2023-02-11 00:44:00 +08:00
|
|
|
// 引入windi css
|
2023-07-29 14:40:55 +08:00
|
|
|
import '@/plugins/unocss'
|
2023-02-11 00:44:00 +08:00
|
|
|
|
|
|
|
// 导入全局的svg图标
|
|
|
|
import '@/plugins/svgIcon'
|
|
|
|
|
|
|
|
// 初始化多语言
|
|
|
|
import { setupI18n } from '@/plugins/vueI18n'
|
|
|
|
|
|
|
|
// 引入状态管理
|
|
|
|
import { setupStore } from '@/store'
|
|
|
|
|
|
|
|
// 全局组件
|
|
|
|
import { setupGlobCom } from '@/components'
|
|
|
|
|
|
|
|
// 引入 element-plus
|
|
|
|
import { setupElementPlus } from '@/plugins/elementPlus'
|
|
|
|
|
|
|
|
// 引入 form-create
|
|
|
|
import { setupFormCreate } from '@/plugins/formCreate'
|
|
|
|
|
|
|
|
// 引入全局样式
|
|
|
|
import '@/styles/index.scss'
|
|
|
|
|
|
|
|
// 引入动画
|
|
|
|
import '@/plugins/animate.css'
|
|
|
|
|
|
|
|
// 路由
|
|
|
|
import router, { setupRouter } from '@/router'
|
|
|
|
|
|
|
|
// 权限
|
|
|
|
import { setupAuth } from '@/directives'
|
|
|
|
|
|
|
|
import { createApp } from 'vue'
|
|
|
|
|
|
|
|
import App from './App.vue'
|
|
|
|
|
|
|
|
import './permission'
|
|
|
|
|
2023-04-06 19:49:58 +08:00
|
|
|
import '@/plugins/tongji' // 百度统计
|
2023-02-11 00:44:00 +08:00
|
|
|
import Logger from '@/utils/Logger'
|
|
|
|
|
2023-05-31 15:58:35 +08:00
|
|
|
import VueDOMPurifyHTML from 'vue-dompurify-html' // 解决v-html 的安全隐患
|
|
|
|
|
2023-02-11 00:44:00 +08:00
|
|
|
// 创建实例
|
|
|
|
const setupAll = async () => {
|
|
|
|
const app = createApp(App)
|
|
|
|
|
|
|
|
await setupI18n(app)
|
|
|
|
|
|
|
|
setupStore(app)
|
|
|
|
|
|
|
|
setupGlobCom(app)
|
|
|
|
|
|
|
|
setupElementPlus(app)
|
|
|
|
|
|
|
|
setupFormCreate(app)
|
|
|
|
|
|
|
|
setupRouter(app)
|
|
|
|
|
|
|
|
setupAuth(app)
|
|
|
|
|
|
|
|
await router.isReady()
|
|
|
|
|
2023-05-31 15:58:35 +08:00
|
|
|
app.use(VueDOMPurifyHTML)
|
|
|
|
|
2023-02-11 00:44:00 +08:00
|
|
|
app.mount('#app')
|
|
|
|
}
|
|
|
|
|
|
|
|
setupAll()
|
|
|
|
|
|
|
|
Logger.prettyPrimary(`欢迎使用`, import.meta.env.VITE_APP_TITLE)
|