UNPKG

iles

Version:

Vite & Vue powered static site generator with partial hydration

34 lines (33 loc) 858 B
import { reactive } from 'vue'; /** * Converts ref to a reactive value. * * @see https://vueuse.org/toReactive */ export function toReactive(objectRef) { const proxy = new Proxy({}, { get(_, p, receiver) { return Reflect.get(objectRef.value, p, receiver); }, set(_, p, value) { objectRef.value[p] = value; return true; }, deleteProperty(_, p) { return Reflect.deleteProperty(objectRef.value, p); }, has(_, p) { return Reflect.has(objectRef.value, p); }, ownKeys() { return Object.keys(objectRef.value); }, getOwnPropertyDescriptor() { return { enumerable: true, configurable: true, }; }, }); return reactive(proxy); }