2024-06-08 11:49:06 +00:00
|
|
|
import { createApp } from 'vue';
|
2024-05-24 15:11:03 +00:00
|
|
|
|
2024-06-08 11:49:06 +00:00
|
|
|
import '@vben/styles';
|
2024-07-08 14:30:19 +00:00
|
|
|
import '@vben/styles/antd';
|
2024-06-01 15:15:29 +00:00
|
|
|
import { preferences } from '@vben-core/preferences';
|
|
|
|
|
2024-07-06 16:17:44 +00:00
|
|
|
import { loadMessages, setupI18n } from '#/locales';
|
2024-06-16 15:40:52 +00:00
|
|
|
import { setupStore } from '#/store';
|
2024-05-24 15:11:03 +00:00
|
|
|
|
|
|
|
import App from './app.vue';
|
|
|
|
import { router } from './router';
|
|
|
|
|
2024-05-25 14:43:22 +00:00
|
|
|
async function bootstrap(namespace: string) {
|
2024-05-24 15:11:03 +00:00
|
|
|
const app = createApp(App);
|
|
|
|
|
|
|
|
// 国际化 i18n 配置
|
2024-06-30 07:42:30 +00:00
|
|
|
await setupI18n(app, {
|
|
|
|
defaultLocale: preferences.app.locale,
|
2024-07-06 16:17:44 +00:00
|
|
|
loadMessages,
|
2024-07-06 18:00:51 +00:00
|
|
|
missingWarn: import.meta.env.PROD,
|
2024-06-30 07:42:30 +00:00
|
|
|
});
|
2024-05-24 15:11:03 +00:00
|
|
|
|
|
|
|
// 配置 pinia-store
|
2024-05-25 14:43:22 +00:00
|
|
|
await setupStore(app, { namespace });
|
2024-05-24 15:11:03 +00:00
|
|
|
|
|
|
|
// 配置路由及路由守卫
|
|
|
|
app.use(router);
|
|
|
|
|
|
|
|
app.mount('#app');
|
|
|
|
}
|
|
|
|
|
|
|
|
export { bootstrap };
|