mirror of
https://github.com/imdap/ruoyi-plus-vben5.git
synced 2026-04-23 08:48:35 +08:00
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:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user