Merge pull request #56 from taoabc/master

fix: 修复缩略图拖拽至画布出现文本元素
This commit is contained in:
LLzzZZ 2021-07-04 16:16:21 +08:00 committed by GitHub
commit 992220cc3c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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) => {
if (!e.dataTransfer) return
if (!e.dataTransfer || e.dataTransfer.items.length === 0) return
const dataTransferItem = e.dataTransfer.items[0]
// 检查事件对象中是否存在图片,存在则插入图片,否则继续检查是否存在文字,存在则插入文字

View File

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