From c55f662d05d8d7303ec9586592a67a36936b4a2a Mon Sep 17 00:00:00 2001 From: vayci Date: Mon, 16 Jan 2023 11:10:13 +0800 Subject: [PATCH] feat: update comment list sorter (#821) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #### What type of PR is this? /kind feature #### What this PR does / why we need it: 修改评论列表默认排序规则,以实现最新评论或最新回复的评论总显示在最前 #### Which issue(s) this PR fixes: Fixes https://github.com/halo-dev/halo/issues/3138 #### Screenshots: ![image](https://user-images.githubusercontent.com/17878156/212250458-edaeb149-8c3f-411d-b72b-5a70677cd300.png) #### Special notes for your reviewer: #### Does this PR introduce a user-facing change? ```release-note 修改评论列表默认排序规则,排序方式新增“最后回复时间”排序方式 ``` --- src/modules/contents/comments/CommentList.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/modules/contents/comments/CommentList.vue b/src/modules/contents/comments/CommentList.vue index 9c74318c1..3d46d3839 100644 --- a/src/modules/contents/comments/CommentList.vue +++ b/src/modules/contents/comments/CommentList.vue @@ -221,6 +221,10 @@ const SortFilterItems: { }[] = [ { label: "默认", + value: undefined, + }, + { + label: "最后回复时间", value: "LAST_REPLY_TIME", }, { @@ -283,7 +287,7 @@ function handleClearKeyword() { const hasFilters = computed(() => { return ( selectedApprovedFilterItem.value.value !== undefined || - selectedSortFilterItem.value.value !== "LAST_REPLY_TIME" || + selectedSortFilterItem.value.value !== undefined || selectedUser.value || keyword.value ); @@ -358,7 +362,7 @@ function handleClearFilters() { 排序:{{ selectedSortFilterItem.label }}