注册必填 7-32 位账号,手机号区号/本地号分存;登录默认账号模式并支持切换手机号登录;Player i18n 拆包与赛事接口优化。 Co-authored-by: Cursor <cursoragent@cursor.com>
40 lines
975 B
TypeScript
40 lines
975 B
TypeScript
import { createApp } from 'vue';
|
|
import { createPinia } from 'pinia';
|
|
import { createI18n } from 'vue-i18n';
|
|
import App from './App.vue';
|
|
import router from './router/index.ts';
|
|
import './styles.css';
|
|
import {
|
|
loadLocaleMessages,
|
|
markLocaleLoaded,
|
|
readStoredLocale,
|
|
type PlayerLocale,
|
|
} from './i18n/index.ts';
|
|
|
|
async function bootstrap() {
|
|
const initialLocale = readStoredLocale();
|
|
const initialMessages = await loadLocaleMessages(initialLocale);
|
|
|
|
const i18n = createI18n({
|
|
legacy: false,
|
|
locale: initialLocale,
|
|
fallbackLocale: ['en-US', 'zh-CN'],
|
|
messages: {
|
|
[initialLocale]: initialMessages as Record<string, string>,
|
|
},
|
|
});
|
|
|
|
markLocaleLoaded(initialLocale);
|
|
|
|
createApp(App).use(createPinia()).use(router).use(i18n).mount('#app');
|
|
|
|
const loader = document.getElementById('app-loading');
|
|
if (loader) {
|
|
loader.style.opacity = '0';
|
|
loader.style.transition = 'opacity 0.3s ease';
|
|
setTimeout(() => loader.remove(), 350);
|
|
}
|
|
}
|
|
|
|
bootstrap();
|