fix: vxe i18n

This commit is contained in:
xiaoxian521 2022-03-13 15:49:13 +08:00
parent a7576f6971
commit 0bba4b7d64

View File

@ -66,6 +66,13 @@ VXETable.setup({
return unref(i18n.global.locale) === "zh"
? XEUtils.toFormatString(XEUtils.get(zh, key), args)
: XEUtils.toFormatString(XEUtils.get(en, key), args);
},
translate(key) {
const NAMESPACED = ["el.", "buttons."];
if (key && NAMESPACED.findIndex(v => key.includes(v)) !== -1) {
return i18n.global.t.call(i18n.global.locale, key);
}
return key;
}
});