feat(projects): add the plugin: vite-plugin-vue-transition-root-validator, to optimize the development experience.

This commit is contained in:
Azir-11
2026-01-18 18:44:42 +08:00
committed by Soybean
parent 706586439d
commit 30e3cdc7b9
5 changed files with 28 additions and 2 deletions

View File

@@ -24,3 +24,7 @@ export const $t = i18n.global.t as App.I18n.$T;
export function setLocale(locale: App.I18n.LangType) {
i18n.global.locale.value = locale;
}
export function getLocale(): App.I18n.LangType {
return i18n.global.locale.value as App.I18n.LangType;
}

View File

@@ -1,9 +1,10 @@
import { createApp } from 'vue';
import './plugins/assets';
import { setupVueRootValidator } from 'vite-plugin-vue-transition-root-validator/client';
import { setupAppVersionNotification, setupDayjs, setupIconifyOffline, setupLoading, setupNProgress } from './plugins';
import { setupStore } from './store';
import { setupRouter } from './router';
import { setupI18n } from './locales';
import { getLocale, setupI18n } from './locales';
import App from './App.vue';
async function setupApp() {
@@ -25,6 +26,10 @@ async function setupApp() {
setupAppVersionNotification();
setupVueRootValidator(app, {
lang: getLocale() === 'zh-CN' ? 'zh' : 'en'
});
app.mount('#app');
}