mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-08-27 09:34:19 +08:00
refactor: refactored multi-language modules to support lazy loading and remote loading
This commit is contained in:
45
src/main.ts
45
src/main.ts
@@ -14,33 +14,36 @@ import { registerGlobComp } from '/@/components/registerGlobComp';
|
||||
|
||||
import { isDevMode } from '/@/utils/env';
|
||||
|
||||
const app = createApp(App);
|
||||
(async () => {
|
||||
const app = createApp(App);
|
||||
|
||||
// Register global components
|
||||
registerGlobComp(app);
|
||||
// Register global components
|
||||
registerGlobComp(app);
|
||||
|
||||
// Multilingual configuration
|
||||
setupI18n(app);
|
||||
// Configure routing
|
||||
setupRouter(app);
|
||||
|
||||
// Configure routing
|
||||
setupRouter(app);
|
||||
// Configure vuex store
|
||||
setupStore(app);
|
||||
|
||||
// Configure vuex store
|
||||
setupStore(app);
|
||||
// Register global directive
|
||||
setupGlobDirectives(app);
|
||||
|
||||
// Register global directive
|
||||
setupGlobDirectives(app);
|
||||
// Configure global error handling
|
||||
setupErrorHandle(app);
|
||||
|
||||
// Configure global error handling
|
||||
setupErrorHandle(app);
|
||||
await Promise.all([
|
||||
// Multilingual configuration
|
||||
setupI18n(app),
|
||||
// Mount when the route is ready
|
||||
router.isReady(),
|
||||
]);
|
||||
|
||||
// Mount when the route is ready
|
||||
router.isReady().then(() => {
|
||||
app.mount('#app', true);
|
||||
});
|
||||
|
||||
// The development environment takes effect
|
||||
if (isDevMode()) {
|
||||
app.config.performance = true;
|
||||
window.__APP__ = app;
|
||||
}
|
||||
// The development environment takes effect
|
||||
if (isDevMode()) {
|
||||
app.config.performance = true;
|
||||
window.__APP__ = app;
|
||||
}
|
||||
})();
|
||||
|
Reference in New Issue
Block a user