| /* |
| * Licensed to the Apache Software Foundation (ASF) under one or more |
| * contributor license agreements. See the NOTICE file distributed with |
| * this work for additional information regarding copyright ownership. |
| * The ASF licenses this file to You under the Apache License, Version 2.0 |
| * (the "License"); you may not use this file except in compliance with |
| * the License. You may obtain a copy of the License at |
| * |
| * https://www.apache.org/licenses/LICENSE-2.0 |
| * |
| * Unless required by applicable law or agreed to in writing, software |
| * distributed under the License is distributed on an "AS IS" BASIS, |
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| * See the License for the specific language governing permissions and |
| * limitations under the License. |
| */ |
| import 'virtual:windi-base.css'; |
| import 'virtual:windi-components.css'; |
| import '/@/design/index.less'; |
| import 'virtual:windi-utilities.css'; |
| // Register icon sprite |
| import 'virtual:svg-icons-register'; |
| import App from './App.vue'; |
| import { createApp } from 'vue'; |
| 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'; |
| |
| import { isDevMode } from './utils/env'; |
| |
| if (isDevMode()) { |
| import('ant-design-vue/es/style'); |
| } |
| async function bootstrap() { |
| const app = createApp(App); |
| |
| // Configure 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(); |