Browse Source

fix: vxe i18n

xiaoxian521 3 năm trước cách đây
mục cha
commit
0bba4b7d64
1 tập tin đã thay đổi với 7 bổ sung0 xóa
  1. 7 0
      src/plugins/vxe-table/index.ts

+ 7 - 0
src/plugins/vxe-table/index.ts

@@ -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;
   }
 });