Sha256: d7b7d24011ec33945105db735204ef031b80194575ccf77aa87c139e9f52e0c8
Contents?: true
Size: 503 Bytes
Versions: 23
Compression:
Stored size: 503 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 default CocoComponent; export { CocoComponent };
Version data entries
23 entries across 23 versions & 1 rubygems