mirror of
https://github.com/soybeanjs/soybean-admin.git
synced 2026-02-08 23:24:26 +08:00
feat(projects): add the plugin: vite-plugin-vue-transition-root-validator, to optimize the development experience.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user