DragPreviewImage

Component that renders an HTML Image element as a drag preview.

usage

<script lang="ts" setup>
import { DragPreviewImage, useDrag } from 'vue3-dnd'
const [collect, drag, dragPreview] = useDrag(() => ({
   type: 'Box',
}))
</script>

<template>
     <DragPreviewImage :connect="dragPreview" src="house_dragged.png" />
     <div :ref="drag">🏠</div>
</template>
copy success

Props

ParametersDescriptionTypeRequired
srcsrc of the imagestringyes
connectdragPreview connectorfunctionyes