mirror of
https://github.com/WeBankFinTech/fes.js.git
synced 2025-04-05 19:41:57 +08:00
fix(plugin-locale):修复导出函数t
This commit is contained in:
parent
b68384a027
commit
11d4e68d60
@ -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,
|
||||||
|
3
packages/fes-plugin-locale/types.d.ts
vendored
3
packages/fes-plugin-locale/types.d.ts
vendored
@ -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' {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user