Sha256: 08df493281abe8c9b8f0e6bb4c3835702842ddf3fed7dd04a723c6493231202e
Contents?: true
Size: 473 Bytes
Versions: 35
Compression:
Stored size: 473 Bytes
Contents
import { getData } from "@helpers/alpine"; import { nameFunction } from "@helpers/lang"; function CocoComponent(name, fn) { const func = nameFunction(name, (...args) => { const data = fn(...args); Object.defineProperties(data, { $parent: { get() { return getData(this.$root.parentElement); }, }, }); data.$options = {}; return data; }); func.component = true; return func; } export { CocoComponent };
Version data entries
35 entries across 35 versions & 1 rubygems