From 1432018ad97e6fccaa8f1d847dda376c4ba432b8 Mon Sep 17 00:00:00 2001 From: kongjing Date: Tue, 5 Sep 2023 18:20:56 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BB=A3=E7=A0=81=E5=A4=8D=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/doc/src/components/markdown/index.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/doc/src/components/markdown/index.tsx b/packages/doc/src/components/markdown/index.tsx index abb93332..52c09dd6 100644 --- a/packages/doc/src/components/markdown/index.tsx +++ b/packages/doc/src/components/markdown/index.tsx @@ -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('复制成功!', {