refactor(comments): 统一评论组件头部元素的类名

将评论组件头部的类名从`.cwd-header`和`.cwd-count-number`统一修改为`.cwd-comments-header`和`.cwd-comments-count-number`,提高代码可读性和一致性
This commit is contained in:
anghunk
2026-01-21 15:52:24 +08:00
parent e7f7f23944
commit 164ef678ba

View File

@@ -281,7 +281,7 @@ export class CWDComments {
} }
// 创建头部统计 // 创建头部统计
let header = this.mountPoint.querySelector('.cwd-header'); let header = this.mountPoint.querySelector('.cwd-comments-header');
if (!header) { if (!header) {
header = document.createElement('div'); header = document.createElement('div');
header.className = 'cwd-comments-header'; header.className = 'cwd-comments-header';
@@ -292,7 +292,7 @@ export class CWDComments {
`; `;
this.mountPoint.appendChild(header); this.mountPoint.appendChild(header);
} }
const countEl = header.querySelector('.cwd-count-number'); const countEl = header.querySelector('.cwd-comments-count-number');
if (countEl) { if (countEl) {
countEl.textContent = state.pagination.totalCount; countEl.textContent = state.pagination.totalCount;
} }
@@ -400,8 +400,8 @@ export class CWDComments {
} }
// 更新头部统计 // 更新头部统计
const header = this.mountPoint?.querySelector('.cwd-header'); const header = this.mountPoint?.querySelector('.cwd-comments-header');
const countEl = header?.querySelector('.cwd-count-number'); const countEl = header?.querySelector('.cwd-comments-count-number');
if (countEl) { if (countEl) {
countEl.textContent = state.pagination.totalCount; countEl.textContent = state.pagination.totalCount;
} }