quasar
Version:
Build high-performance VueJS user interfaces (SPA, PWA, SSR, Mobile and Desktop) in record time
16 lines (14 loc) • 312 B
JavaScript
export function injectProp (target, propName, get, set) {
Object.defineProperty(target, propName, {
get,
set,
enumerable: true
})
return target
}
export function injectMultipleProps (target, props) {
for (const key in props) {
injectProp(target, key, props[ key ])
}
return target
}