FlowPacs/yudao-ui-admin-vue3/src/main.ts

55 lines
877 B
TypeScript
Raw Normal View History

2022-07-18 19:06:37 +08:00
// 引入windi css
import '@/plugins/windi.css'
2022-07-19 22:33:54 +08:00
2022-07-18 19:06:37 +08:00
// 导入全局的svg图标
import '@/plugins/svgIcon'
2022-07-19 22:33:54 +08:00
2022-07-18 19:06:37 +08:00
// 初始化多语言
import { setupI18n } from '@/plugins/vueI18n'
2022-07-19 22:33:54 +08:00
2022-07-18 19:06:37 +08:00
// 引入状态管理
import { setupStore } from '@/store'
2022-07-19 22:33:54 +08:00
2022-07-18 19:06:37 +08:00
// 全局组件
import { setupGlobCom } from '@/components'
2022-07-19 22:33:54 +08:00
2022-07-18 19:06:37 +08:00
// 引入element-plus
import { setupElementPlus } from '@/plugins/elementPlus'
2022-07-19 22:33:54 +08:00
2022-07-18 19:06:37 +08:00
// 引入全局样式
import '@/styles/index.less'
2022-07-19 22:33:54 +08:00
2022-07-18 19:06:37 +08:00
// 引入动画
import '@/plugins/animate.css'
2022-07-19 22:33:54 +08:00
2022-07-18 19:06:37 +08:00
// 路由
import { setupRouter } from './router'
2022-07-19 22:33:54 +08:00
2022-07-18 19:06:37 +08:00
// 权限
2022-07-19 22:33:54 +08:00
import { setupAuth } from './directives'
2022-07-18 19:06:37 +08:00
import { createApp } from 'vue'
2022-07-19 22:33:54 +08:00
2022-07-18 19:06:37 +08:00
import App from './App.vue'
2022-07-19 22:33:54 +08:00
2022-07-18 19:06:37 +08:00
// 创建实例
const setupAll = async () => {
const app = createApp(App)
await setupI18n(app)
setupStore(app)
setupGlobCom(app)
setupElementPlus(app)
setupRouter(app)
setupAuth(app)
app.mount('#app')
}
setupAll()