Browse Source

feat: update comment list sorter (#821)

#### 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
修改评论列表默认排序规则,排序方式新增“最后回复时间”排序方式
```
pull/823/head
vayci 2 years ago committed by GitHub
parent
commit
c55f662d05
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      src/modules/contents/comments/CommentList.vue

8
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() {
</FilterTag>
<FilterTag
v-if="selectedSortFilterItem.value != 'LAST_REPLY_TIME'"
v-if="selectedSortFilterItem.value != undefined"
@close="handleSortFilterItemChange(SortFilterItems[0])"
>
排序{{ selectedSortFilterItem.label }}

Loading…
Cancel
Save