diff --git a/src/views/Editor/Canvas/hooks/useDropImageOrText.ts b/src/views/Editor/Canvas/hooks/useDropImageOrText.ts index 8cb3357e..afceaadb 100644 --- a/src/views/Editor/Canvas/hooks/useDropImageOrText.ts +++ b/src/views/Editor/Canvas/hooks/useDropImageOrText.ts @@ -12,7 +12,7 @@ export default (elementRef: Ref) => { // 拖拽元素到画布中 const handleDrop = (e: DragEvent) => { - if (!e.dataTransfer) return + if (!e.dataTransfer || e.dataTransfer.items.length === 0) return const dataTransferItem = e.dataTransfer.items[0] // 检查事件对象中是否存在图片,存在则插入图片,否则继续检查是否存在文字,存在则插入文字 diff --git a/src/views/Editor/Thumbnails/index.vue b/src/views/Editor/Thumbnails/index.vue index 22335a1e..4c9438ca 100644 --- a/src/views/Editor/Thumbnails/index.vue +++ b/src/views/Editor/Thumbnails/index.vue @@ -12,6 +12,7 @@ :animation="300" :scroll="true" :scrollSensitivity="50" + :setData="null" @end="handleDragEnd" itemKey="id" >