- 后端
- HTML5
Made with ❤️ by 紫升
用于将 HTML 图像元素渲染为断开的拖动预览的组件。
import { DragPreviewImage, DragSource } from 'react-dnd';function DraggableHouse({ connectDragSource, connectDragPreview }) {return (<><DragPreviewImage src="house_dragged.png" connect={connectDragPreview} /><div ref={connectDragSource}>🏠</div></>);}export default DragSource(/* ... */(connect, monitor) => ({connectDragSource: connect.dragSource(),connectDragPreview: connect.dragPreview(),}),);