fix: vxe i18n (#7675)

* chore: engines node

* chore: update deps

* fix: oxlint

* chore: fix lint issues

* chore: update deps

* fix: vxe i18n
This commit is contained in:
xingyu
2026-03-16 18:24:28 +08:00
committed by GitHub
parent 37d72c1628
commit 186914bcac
3 changed files with 202 additions and 192 deletions

View File

@@ -52,6 +52,16 @@ let isInit = false;
let tableFormFactory: typeof useVbenForm | undefined;
function normalizeVxeLocale<T extends Record<string, any>>(localeModule: T) {
return (
localeModule &&
typeof localeModule === 'object' &&
'default' in localeModule
? localeModule.default
: localeModule
) as T;
}
export const useTableForm: typeof useVbenForm = ((...args) => {
if (!tableFormFactory) {
throw new Error('useTableForm is not initialized');
@@ -116,8 +126,8 @@ export function setupVbenVxeTable(setupOptions: SetupVxeTable) {
const { isDark, locale } = usePreferences();
const localMap = {
'zh-CN': zhCN,
'en-US': enUS,
'zh-CN': normalizeVxeLocale(zhCN),
'en-US': normalizeVxeLocale(enUS),
};
watch(