From f3e8c13dde500f98635ce596dc9308bbf67f0bc0 Mon Sep 17 00:00:00 2001 From: huhaitao Date: Wed, 30 Jun 2021 21:29:31 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=BC=A9=E7=95=A5=E5=9B=BE=E6=8B=96?= =?UTF-8?q?=E6=8B=BD=E8=87=B3=E7=94=BB=E5=B8=83=E5=87=BA=E7=8E=B0=E6=96=87?= =?UTF-8?q?=E6=9C=AC=E5=85=83=E7=B4=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Editor/Canvas/hooks/useDropImageOrText.ts | 2 +- src/views/Editor/Thumbnails/index.vue | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) 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" >