UNPKG

vue3-dnd

Version:

Drag and Drop for Vue Composition API

12 lines (11 loc) 397 B
import { DragSourceImpl } from "./DragSourceImpl"; import { computed, unref, watchEffect } from "vue-demi"; export function useDragSource(spec, monitor, connector) { var handler = computed(function() { return new DragSourceImpl(unref(spec), unref(monitor), unref(connector)); }); watchEffect(function() { handler.value.spec = unref(spec); }); return handler; }