Merge pull request #12 from zpj80231/fix/next-page

fix(widget): 修复评论列表下一页、上一页超过第二页时的失效问题
This commit is contained in:
anghunk
2026-03-26 10:00:11 +08:00
committed by GitHub

View File

@@ -466,8 +466,14 @@ export class CWDComments {
onUpdateReplyContent: (content) => this.store.updateReplyContent(content), onUpdateReplyContent: (content) => this.store.updateReplyContent(content),
onClearReplyError: () => this.store.clearReplyError(), onClearReplyError: () => this.store.clearReplyError(),
replyPlaceholder: this.config.commentPlaceholder, replyPlaceholder: this.config.commentPlaceholder,
onPrevPage: () => this.store.goToPage(state.pagination.page - 1), onPrevPage: () => {
onNextPage: () => this.store.goToPage(state.pagination.page + 1), const currentState = this.store.store.getState();
this.store.goToPage(currentState.pagination.page - 1);
},
onNextPage: () => {
const currentState = this.store.store.getState();
this.store.goToPage(currentState.pagination.page + 1);
},
onGoToPage: (page) => this.store.goToPage(page), onGoToPage: (page) => this.store.goToPage(page),
onLikeComment: (commentId, isLike) => { onLikeComment: (commentId, isLike) => {
if (this.store && typeof this.store.likeComment === 'function') { if (this.store && typeof this.store.likeComment === 'function') {