From 298f1dc98fef6a57e62ef1dd20ec03608c19c890 Mon Sep 17 00:00:00 2001 From: anghunk Date: Mon, 26 Jan 2026 17:47:22 +0800 Subject: [PATCH] =?UTF-8?q?fix(CommentItem):=20=E4=BF=AE=E6=94=B9=E8=AF=84?= =?UTF-8?q?=E8=AE=BA=E5=86=85=E5=AE=B9=E4=B8=BA=E6=96=87=E6=9C=AC=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=EF=BC=8C=E4=BC=98=E5=8C=96=E9=98=B2=E6=8A=96=E6=A3=80?= =?UTF-8?q?=E6=9F=A5=E6=B3=A8=E9=87=8A=20style(main.css):=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E7=99=BD=E7=A9=BA=E6=A0=BC=E5=A4=84=E7=90=86=EF=BC=8C?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=8A=A8=E7=94=BB=E6=95=88=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/widget/src/components/CommentItem.js | 8 ++++---- docs/widget/src/styles/main.css | 5 ++++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/docs/widget/src/components/CommentItem.js b/docs/widget/src/components/CommentItem.js index a1cfb7d..2acb497 100644 --- a/docs/widget/src/components/CommentItem.js +++ b/docs/widget/src/components/CommentItem.js @@ -197,10 +197,10 @@ export class CommentItem extends Component { ] }); - // 设置评论内容的 HTML + // 设置评论内容的 TEXT const contentEl = root.querySelector('.cwd-comment-content'); if (contentEl) { - contentEl.innerHTML = comment.contentHtml; + contentEl.innerHTML = comment.contentText; } // 创建回复编辑器 @@ -343,7 +343,7 @@ export class CommentItem extends Component { const commentId = String(this.props.comment.id); - // 防抖检查:1秒内同一评论只能操作一次 + // 防抖检查:1 秒内同一评论只能操作一次 const now = Date.now(); const debounceKey = `${this.getUserId()}_${commentId}`; const lastClick = CommentItem._likeDebounce.get(debounceKey); @@ -424,7 +424,7 @@ export class CommentItem extends Component { /** * 检查是否已点赞 - * @param {string|number} commentId - 评论ID + * @param {string|number} commentId - 评论 ID * @returns {boolean} 是否已点赞 */ hasLiked(commentId) { diff --git a/docs/widget/src/styles/main.css b/docs/widget/src/styles/main.css index 95cd6d7..1d0ffd1 100644 --- a/docs/widget/src/styles/main.css +++ b/docs/widget/src/styles/main.css @@ -395,6 +395,7 @@ line-height: 1.6; color: var(--cwd-text, #24292f); word-wrap: break-word; + white-space: pre-wrap; margin-top: 10px; } @@ -573,9 +574,11 @@ 0% { transform: scale(1); } + 50% { transform: scale(1.2); } + 100% { transform: scale(1.05); } @@ -980,4 +983,4 @@ background: transparent; padding: 0; color: #db850d; -} +} \ No newline at end of file