fix: copy triggers page status updates

This commit is contained in:
YangFong 2024-12-22 21:16:45 +08:00
parent 6178ab2433
commit 0061505676

View File

@ -133,10 +133,9 @@ function copy() {
window.getSelection()!.removeAllRanges()
if (copyMode.value === `html`) {
await copyContent(clipboardDiv.innerHTML)
}
else {
const temp = clipboardDiv.innerHTML
if (copyMode.value === `txt`) {
const range = document.createRange()
range.setStartBefore(clipboardDiv.firstChild!)
range.setEndAfter(clipboardDiv.lastChild!)
@ -151,6 +150,10 @@ function copy() {
nextTick(() => toggleDark())
}
if (copyMode.value === `html`) {
await copyContent(temp)
}
//
toast.success(copyMode.value === `html` ? `已复制 HTML 源码,请进行下一步操作。` : `已复制渲染后的文章到剪贴板,可直接到公众号后台粘贴。`)