mirror of
https://github.com/soybeanjs/soybean-admin.git
synced 2025-12-25 22:30:19 +08:00
feat(projects): new i18n function $t & login page and setting drawer config i18n
This commit is contained in:
@@ -35,7 +35,7 @@ import { routePath } from '@/router';
|
||||
import { useRouteStore, useThemeStore } from '@/store';
|
||||
import { useRouterPush } from '@/composables';
|
||||
import { getBreadcrumbByRouteKey } from '@/utils';
|
||||
import { t } from '@/locales';
|
||||
import { $t } from '@/locales';
|
||||
|
||||
defineOptions({ name: 'GlobalBreadcrumb' });
|
||||
|
||||
@@ -48,8 +48,8 @@ const breadcrumbs = computed(() =>
|
||||
getBreadcrumbByRouteKey(route.name as string, routeStore.menus as App.GlobalMenuOption[], routePath('root')).map(
|
||||
item => ({
|
||||
...item,
|
||||
label: item.i18nTitle ? t(item.i18nTitle) : item.label,
|
||||
options: item.options?.map(oItem => ({ ...oItem, label: oItem.i18nTitle ? t(oItem.i18nTitle) : oItem.label }))
|
||||
label: item.i18nTitle ? $t(item.i18nTitle) : item.label,
|
||||
options: item.options?.map(oItem => ({ ...oItem, label: oItem.i18nTitle ? $t(oItem.i18nTitle) : oItem.label }))
|
||||
})
|
||||
)
|
||||
);
|
||||
|
||||
@@ -15,7 +15,7 @@ import { localStg } from '@/utils';
|
||||
const theme = useThemeStore();
|
||||
const { locale } = useI18n();
|
||||
|
||||
const language = ref<I18nType.langType>(localStg.get('lang') || 'zh-CN');
|
||||
const language = ref<I18nType.LangType>(localStg.get('lang') || 'zh-CN');
|
||||
const options = [
|
||||
{
|
||||
label: '中文',
|
||||
@@ -31,9 +31,9 @@ const options = [
|
||||
}
|
||||
];
|
||||
const handleSelect = (key: string) => {
|
||||
language.value = key as I18nType.langType;
|
||||
language.value = key as I18nType.LangType;
|
||||
locale.value = key;
|
||||
localStg.set('lang', key as I18nType.langType);
|
||||
localStg.set('lang', key as I18nType.LangType);
|
||||
};
|
||||
</script>
|
||||
<style scoped></style>
|
||||
|
||||
Reference in New Issue
Block a user