mirror of
https://github.com/doocs/md.git
synced 2025-01-23 04:14:42 +08:00
fix: copy triggers page status updates
This commit is contained in:
parent
6178ab2433
commit
0061505676
@ -133,10 +133,9 @@ function copy() {
|
|||||||
|
|
||||||
window.getSelection()!.removeAllRanges()
|
window.getSelection()!.removeAllRanges()
|
||||||
|
|
||||||
if (copyMode.value === `html`) {
|
const temp = clipboardDiv.innerHTML
|
||||||
await copyContent(clipboardDiv.innerHTML)
|
|
||||||
}
|
if (copyMode.value === `txt`) {
|
||||||
else {
|
|
||||||
const range = document.createRange()
|
const range = document.createRange()
|
||||||
range.setStartBefore(clipboardDiv.firstChild!)
|
range.setStartBefore(clipboardDiv.firstChild!)
|
||||||
range.setEndAfter(clipboardDiv.lastChild!)
|
range.setEndAfter(clipboardDiv.lastChild!)
|
||||||
@ -151,6 +150,10 @@ function copy() {
|
|||||||
nextTick(() => toggleDark())
|
nextTick(() => toggleDark())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (copyMode.value === `html`) {
|
||||||
|
await copyContent(temp)
|
||||||
|
}
|
||||||
|
|
||||||
// 输出提示
|
// 输出提示
|
||||||
toast.success(copyMode.value === `html` ? `已复制 HTML 源码,请进行下一步操作。` : `已复制渲染后的文章到剪贴板,可直接到公众号后台粘贴。`)
|
toast.success(copyMode.value === `html` ? `已复制 HTML 源码,请进行下一步操作。` : `已复制渲染后的文章到剪贴板,可直接到公众号后台粘贴。`)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user