fix: 缩略图拖拽至画布出现文本元素

This commit is contained in:
huhaitao 2021-06-30 21:29:31 +08:00
parent f80e119aa0
commit f3e8c13dde
2 changed files with 2 additions and 1 deletions

View File

@ -12,7 +12,7 @@ export default (elementRef: Ref<HTMLElement | undefined>) => {
// 拖拽元素到画布中 // 拖拽元素到画布中
const handleDrop = (e: DragEvent) => { const handleDrop = (e: DragEvent) => {
if (!e.dataTransfer) return if (!e.dataTransfer || e.dataTransfer.items.length === 0) return
const dataTransferItem = e.dataTransfer.items[0] const dataTransferItem = e.dataTransfer.items[0]
// 检查事件对象中是否存在图片,存在则插入图片,否则继续检查是否存在文字,存在则插入文字 // 检查事件对象中是否存在图片,存在则插入图片,否则继续检查是否存在文字,存在则插入文字

View File

@ -12,6 +12,7 @@
:animation="300" :animation="300"
:scroll="true" :scroll="true"
:scrollSensitivity="50" :scrollSensitivity="50"
:setData="null"
@end="handleDragEnd" @end="handleDragEnd"
itemKey="id" itemKey="id"
> >