From 130a7fc0776d358711114842310d97c9042c252e Mon Sep 17 00:00:00 2001 From: Teages Date: Tue, 2 Jan 2024 18:27:56 +0800 Subject: [PATCH] feat: add setLocale --- src/runtime/composables/locale.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/runtime/composables/locale.ts b/src/runtime/composables/locale.ts index f524135..3f3fd69 100644 --- a/src/runtime/composables/locale.ts +++ b/src/runtime/composables/locale.ts @@ -9,6 +9,7 @@ export function useLocales(): { loadedLocales: string[] locales: ReturnType['locales'] locale: WritableComputedRef + setLocale: (code: LocaleCode) => Promise userPrefer: ReturnType['userPrefer'] browserPrefer: ReturnType['browserPrefer'] browserMatch: ReturnType['browserMatch'] @@ -43,5 +44,5 @@ export function useLocales(): { set: setLocale, }) - return { t, loadedLocales, locales, locale, userPrefer, browserPrefer, browserMatch } + return { t, loadedLocales, locales, locale, setLocale, userPrefer, browserPrefer, browserMatch } }