Skip to content

Commit

Permalink
fix: 代码复制
Browse files Browse the repository at this point in the history
  • Loading branch information
kongjing committed Sep 5, 2023
1 parent 4f49952 commit 1432018
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/doc/src/components/markdown/index.tsx
Expand Up @@ -62,7 +62,10 @@ function copyAction() {
const timer = null
item.onclick = () => {
if (timer) return
const parent = item.parentNode
let parent = item.parentNode
if (parent.className !== 'code-box') {
parent = parent.parentNode
}
const code = parent.querySelectorAll('pre code')[0]
copyToClipboard(code.innerText)
toast.success('复制成功!', {
Expand Down

0 comments on commit 1432018

Please sign in to comment.