|
@@ -29,6 +29,7 @@
|
|
|
ref="ref_textarea"
|
|
|
contenteditable="true"
|
|
|
@input="updateMarkdown"
|
|
|
+ @paste="handlePaste"
|
|
|
></div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -115,6 +116,7 @@ const updateMarkdown = (e) => {
|
|
|
app.component('SvgIcon', SvgIcon)
|
|
|
app.mount(varsValue)
|
|
|
fragment.appendChild(varsValue)
|
|
|
+
|
|
|
lastReplacedSpan = varsValue
|
|
|
lastIndex = regex.lastIndex
|
|
|
}
|
|
@@ -137,6 +139,11 @@ const updateMarkdown = (e) => {
|
|
|
}
|
|
|
state.textCount = e.target.innerText?.length || 0
|
|
|
}
|
|
|
+const handlePaste = (e) => {
|
|
|
+ e.preventDefault()
|
|
|
+ const text = (e.clipboardData || window.clipboardData).getData('text')
|
|
|
+ document.execCommand('insertText', false, text)
|
|
|
+}
|
|
|
const onCopy = (text) => {
|
|
|
copy(text)
|
|
|
ElMessage.success('复制成功!')
|