Skip to content

Commit b793e99

Browse files
committed
Fix for not being able to upload same image twice
1 parent 5108aec commit b793e99

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/VueEditor.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,18 @@ export default {
158158
},
159159
160160
emitImageInfo($event) {
161+
const resetUploader = function() {
162+
var uploader = document.getElementById('file-upload');
163+
uploader.value = '';
164+
}
165+
161166
let file = $event.target.files[0]
162167
let Editor = this.quill
163168
let range = Editor.getSelection();
164169
let cursorLocation = range.index
165-
this.$emit('imageAdded', file, Editor, cursorLocation)
170+
this.$emit('imageAdded', file, Editor, cursorLocation, resetUploader)
166171
}
172+
167173
}
168174
}
169175
</script>

0 commit comments

Comments
 (0)