mirror of
https://github.com/doocs/md.git
synced 2025-01-22 20:04:39 +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()
|
||||
|
||||
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 源码,请进行下一步操作。` : `已复制渲染后的文章到剪贴板,可直接到公众号后台粘贴。`)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user