paste raw text

This commit is contained in:
Pete Matsyburka
2024-06-13 10:26:36 +03:00
parent 3b717ae3de
commit 35f159266a
2 changed files with 9 additions and 0 deletions
@@ -10,6 +10,7 @@
style="min-width: 2px"
:class="iconInline ? 'inline' : 'block'"
class="peer outline-none focus:block"
@paste.prevent="onPaste"
@keydown.enter.prevent="blurContenteditable"
@focus="$emit('focus', $event)"
@blur="onBlur"
@@ -97,6 +98,9 @@ export default {
}
},
methods: {
onPaste (e) {
e.target.innerText = (e.clipboardData || window.clipboardData).getData('text/plain')
},
selectContent () {
const el = this.$refs.contenteditable