Skip to content
This repository has been archived by the owner on May 9, 2022. It is now read-only.

Insert prop imageDrop #124

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/editor.js
Expand Up @@ -12,6 +12,10 @@ export default {
required: true,
default: ''
},
imageDrop:{
type:Boolean,
default: true
},
height: {
type: Number,
default: 300,
Expand Down Expand Up @@ -158,6 +162,11 @@ export default {
mounted(){
const content = this.$refs.content
content.innerHTML = this.content
if(!this.imageDrop){
content.addEventListener('drop', function (e) {
e.preventDefault();
}, false);
}
content.addEventListener('mouseup', this.saveCurrentRange, false)
content.addEventListener('keyup', () => {
this.$emit('change', content.innerHTML)
Expand Down Expand Up @@ -190,4 +199,4 @@ export default {
}
})
}
}
}