refactor(comments): 统一评论组件头部元素的类名
将评论组件头部的类名从`.cwd-header`和`.cwd-count-number`统一修改为`.cwd-comments-header`和`.cwd-comments-count-number`,提高代码可读性和一致性
This commit is contained in:
@@ -281,7 +281,7 @@ export class CWDComments {
|
||||
}
|
||||
|
||||
// 创建头部统计
|
||||
let header = this.mountPoint.querySelector('.cwd-header');
|
||||
let header = this.mountPoint.querySelector('.cwd-comments-header');
|
||||
if (!header) {
|
||||
header = document.createElement('div');
|
||||
header.className = 'cwd-comments-header';
|
||||
@@ -292,7 +292,7 @@ export class CWDComments {
|
||||
`;
|
||||
this.mountPoint.appendChild(header);
|
||||
}
|
||||
const countEl = header.querySelector('.cwd-count-number');
|
||||
const countEl = header.querySelector('.cwd-comments-count-number');
|
||||
if (countEl) {
|
||||
countEl.textContent = state.pagination.totalCount;
|
||||
}
|
||||
@@ -400,8 +400,8 @@ export class CWDComments {
|
||||
}
|
||||
|
||||
// 更新头部统计
|
||||
const header = this.mountPoint?.querySelector('.cwd-header');
|
||||
const countEl = header?.querySelector('.cwd-count-number');
|
||||
const header = this.mountPoint?.querySelector('.cwd-comments-header');
|
||||
const countEl = header?.querySelector('.cwd-comments-count-number');
|
||||
if (countEl) {
|
||||
countEl.textContent = state.pagination.totalCount;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user