fix(plugin-locale):修复导出函数t

This commit is contained in:
harrywan 2024-08-27 19:42:55 +08:00
parent b68384a027
commit 11d4e68d60
2 changed files with 4 additions and 3 deletions

View File

@ -80,9 +80,7 @@ const install = (app) => {
app.use(i18n); app.use(i18n);
}; };
const t = (key) => { const t = i18n.global.t;
return i18n.global.t(key)
}
const locale = { const locale = {
setLocale, setLocale,

View File

@ -1,3 +1,5 @@
import type { VueI18n } from 'vue-i18n';
export { useI18n } from 'vue-i18n'; export { useI18n } from 'vue-i18n';
export const locale: { export const locale: {
@ -5,6 +7,7 @@ export const locale: {
addLocale: ({ locale, messages }: { locale: string; messages: object }) => void; addLocale: ({ locale, messages }: { locale: string; messages: object }) => void;
getAllLocales: () => string[]; getAllLocales: () => string[];
messages: Record<string, object>; messages: Record<string, object>;
t: VueI18n['t'];
}; };
declare module '@fesjs/fes' { declare module '@fesjs/fes' {