admin-vben/src/main.ts

64 lines
1.5 KiB
TypeScript
Raw Normal View History

2023-07-29 08:40:09 +00:00
import 'uno.css'
2023-07-30 02:06:13 +00:00
import 'ant-design-vue/dist/reset.css'
import './design/index.less'
2023-07-29 10:46:43 +00:00
2023-03-18 13:10:54 +00:00
// Register icon sprite
import 'virtual:svg-icons-register'
import { createApp } from 'vue'
2023-07-29 10:46:43 +00:00
import App from './App.vue'
2023-03-18 13:10:54 +00:00
import { initAppConfigStore } from '@/logics/initAppConfig'
import { setupErrorHandle } from '@/logics/error-handle'
import { router, setupRouter } from '@/router'
import { setupRouterGuard } from '@/router/guard'
import { setupStore } from '@/store'
import { setupGlobDirectives } from '@/directives'
import { setupI18n } from '@/locales/setupI18n'
import { registerGlobComp } from '@/components/registerGlobComp'
2023-07-29 10:46:43 +00:00
import '@/utils/tongji'
2023-03-18 13:10:54 +00:00
async function bootstrap() {
const app = createApp(App)
// Configure store
// 配置 store
setupStore(app)
// Initialize internal system configuration
// 初始化内部系统配置
initAppConfigStore()
// Register global components
// 注册全局组件
registerGlobComp(app)
// Multilingual configuration
// 多语言配置
// Asynchronous case: language files may be obtained from the server side
// 异步案例:语言文件可能从服务器端获取
await setupI18n(app)
// Configure routing
// 配置路由
setupRouter(app)
// router-guard
// 路由守卫
setupRouterGuard(router)
// Register global directive
// 注册全局指令
setupGlobDirectives(app)
// Configure global error handling
// 配置全局错误处理
setupErrorHandle(app)
// https://next.router.vuejs.org/api/#isready
// await router.isReady();
app.mount('#app')
}
bootstrap()