paste raw text
This commit is contained in:
@@ -65,6 +65,7 @@
|
|||||||
dir="auto"
|
dir="auto"
|
||||||
class="pr-1 cursor-text outline-none block"
|
class="pr-1 cursor-text outline-none block"
|
||||||
style="min-width: 2px"
|
style="min-width: 2px"
|
||||||
|
@paste.prevent="onPaste"
|
||||||
@keydown.enter.prevent="onNameEnter"
|
@keydown.enter.prevent="onNameEnter"
|
||||||
@focus="onNameFocus"
|
@focus="onNameFocus"
|
||||||
@blur="onNameBlur"
|
@blur="onNameBlur"
|
||||||
@@ -191,6 +192,7 @@
|
|||||||
:class="{ 'cursor-text': isContenteditable }"
|
:class="{ 'cursor-text': isContenteditable }"
|
||||||
:placeholder="t('type_value')"
|
:placeholder="t('type_value')"
|
||||||
@blur="onDefaultValueBlur"
|
@blur="onDefaultValueBlur"
|
||||||
|
@paste.prevent="onPaste"
|
||||||
@keydown.enter.prevent="onDefaultValueEnter"
|
@keydown.enter.prevent="onDefaultValueEnter"
|
||||||
>{{ field.default_value }}</span>
|
>{{ field.default_value }}</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -510,6 +512,9 @@ export default {
|
|||||||
|
|
||||||
this.save()
|
this.save()
|
||||||
},
|
},
|
||||||
|
onPaste (e) {
|
||||||
|
e.target.innerText = (e.clipboardData || window.clipboardData).getData('text/plain')
|
||||||
|
},
|
||||||
onResizeCell (e) {
|
onResizeCell (e) {
|
||||||
if (e.target.id === 'mask') {
|
if (e.target.id === 'mask') {
|
||||||
const positionX = e.offsetX / (e.target.clientWidth - 1)
|
const positionX = e.offsetX / (e.target.clientWidth - 1)
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
style="min-width: 2px"
|
style="min-width: 2px"
|
||||||
:class="iconInline ? 'inline' : 'block'"
|
:class="iconInline ? 'inline' : 'block'"
|
||||||
class="peer outline-none focus:block"
|
class="peer outline-none focus:block"
|
||||||
|
@paste.prevent="onPaste"
|
||||||
@keydown.enter.prevent="blurContenteditable"
|
@keydown.enter.prevent="blurContenteditable"
|
||||||
@focus="$emit('focus', $event)"
|
@focus="$emit('focus', $event)"
|
||||||
@blur="onBlur"
|
@blur="onBlur"
|
||||||
@@ -97,6 +98,9 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
onPaste (e) {
|
||||||
|
e.target.innerText = (e.clipboardData || window.clipboardData).getData('text/plain')
|
||||||
|
},
|
||||||
selectContent () {
|
selectContent () {
|
||||||
const el = this.$refs.contenteditable
|
const el = this.$refs.contenteditable
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user