UNPKG

vue-intlayer

Version:

Easily internationalize i18n your Vue applications with type-safe multilingual content management.

37 lines (36 loc) 917 B
import { ref as l, markRaw as i } from "vue"; const s = ({ value: o, children: a, additionalProps: u = {} }) => { const e = l(o); let n = typeof a == "function" ? () => a() : () => a; const v = () => (e.value, n()), r = Object.create(String.prototype); return Object.assign(r, { /* component renderer */ render: v, /* string interpolation */ toString: () => e.value, /* primitive coercion helpers */ valueOf: () => e.value, [Symbol.toPrimitive]: () => e.value, /* reactive getter/setter for the primitive value */ get raw() { return e.value; }, set raw(t) { e.value = t; }, /* circular ref for the ".value" trick */ value: void 0, /* called by useIntlayer when the dictionary entry changes */ __update(t) { n = t.render, this.raw = t.raw; }, ...u }), r.value = r, i(r); }; export { s as renderIntlayerNode };