UNPKG

vue3-dnd

Version:

Drag and Drop for Vue Composition API

12 lines (11 loc) 377 B
import { DropTargetImpl } from "./DropTargetImpl"; import { computed, unref, watchEffect } from "vue-demi"; export function useDropTarget(spec, monitor) { var dropTarget = computed(function() { return new DropTargetImpl(unref(spec), unref(monitor)); }); watchEffect(function() { dropTarget.value.spec = unref(spec); }); return dropTarget; }