UNPKG

vue3-dnd

Version:

Drag and Drop for Vue Composition API

17 lines (16 loc) 589 B
import { computed, unref } from "vue-demi"; import { useConnector } from "../useConnector"; export function useConnectDragSource(connector, spec) { return useConnector(function(state) { unref(connector).hooks.dragSource()(state.el, state.options); }, computed(function() { return unref(spec).options; })); } export function useConnectDragPreview(connector, spec) { return useConnector(function(state) { unref(connector).hooks.dragPreview()(state.el, state.options); }, computed(function() { return unref(spec).previewOptions; })); }