Skip to content

Commit

Permalink
fix: doc复制功能修复
Browse files Browse the repository at this point in the history
  • Loading branch information
kongjing committed Aug 2, 2023
1 parent 41bc77c commit 7648e1b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/doc/src/components/markdown/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,9 @@ function copyAction() {
const timer = null
item.onclick = () => {
if (timer) return
const content = item.innerText
copyToClipboard(content)
const parent = item.parentNode
const code = parent.querySelectorAll('pre code')[0]
copyToClipboard(code)
toast.success('复制成功!', {
style: { position: 'relative', top: 250 },
})
Expand Down

0 comments on commit 7648e1b

Please # to comment.