ant-design-x-vue-next
Version:
Ant Design X for Vue — community continuation aligned with @ant-design/x
24 lines (23 loc) • 640 B
JavaScript
import { inject as m, computed as s } from "vue";
import { LocaleContextKey as p } from "./context.mjs";
import r from "./en_US.mjs";
function v(c, a) {
const t = m(
p,
void 0
), l = s(() => {
var n;
const o = t == null ? void 0 : t.value, e = a || ((n = r) == null ? void 0 : n[c]), i = (o == null ? void 0 : o[c]) ?? {};
return {
...typeof e == "function" ? e() : e,
...i || {}
};
}), u = s(() => {
const o = t == null ? void 0 : t.value, e = o == null ? void 0 : o.locale;
return o != null && o.exist && !e ? r.locale : e || r.locale;
});
return [l, u];
}
export {
v as default
};