chore(useLocale): resolve ts type error
This commit is contained in:
parent
9c8e848684
commit
6b919cd2fc
|
|
@ -7,6 +7,7 @@ import { i18n } from './setupI18n';
|
||||||
import { useLocaleStoreWithOut } from '/@/store/modules/locale';
|
import { useLocaleStoreWithOut } from '/@/store/modules/locale';
|
||||||
import { unref, computed } from 'vue';
|
import { unref, computed } from 'vue';
|
||||||
import { loadLocalePool, setHtmlPageLang } from './helper';
|
import { loadLocalePool, setHtmlPageLang } from './helper';
|
||||||
|
import { Locale } from 'ant-design-vue/es/locale';
|
||||||
|
|
||||||
interface LangModule {
|
interface LangModule {
|
||||||
message: Recordable;
|
message: Recordable;
|
||||||
|
|
@ -32,7 +33,8 @@ export function useLocale() {
|
||||||
const getShowLocalePicker = computed(() => localeStore.getShowPicker);
|
const getShowLocalePicker = computed(() => localeStore.getShowPicker);
|
||||||
|
|
||||||
const getAntdLocale = computed((): any => {
|
const getAntdLocale = computed((): any => {
|
||||||
return i18n.global.getLocaleMessage(unref(getLocale))?.antdLocale ?? {};
|
const localeMessage = i18n.global.getLocaleMessage<{ antdLocale: Locale }>(unref(getLocale));
|
||||||
|
return localeMessage?.antdLocale ?? {};
|
||||||
});
|
});
|
||||||
|
|
||||||
// Switching the language will change the locale of useI18n
|
// Switching the language will change the locale of useI18n
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue