Skip to content
This repository has been archived by the owner on Jan 21, 2024. It is now read-only.

Commit

Permalink
feat: update comment list sorter (#821)
Browse files Browse the repository at this point in the history
#### What type of PR is this?

/kind feature

#### What this PR does / why we need it:

修改评论列表默认排序规则,以实现最新评论或最新回复的评论总显示在最前

#### Which issue(s) this PR fixes:

Fixes halo-dev/halo#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
修改评论列表默认排序规则,排序方式新增“最后回复时间”排序方式
```
  • Loading branch information
vayci authored Jan 16, 2023
1 parent fffbd4a commit c55f662
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/modules/contents/comments/CommentList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,10 @@ const SortFilterItems: {
}[] = [
{
label: "默认",
value: undefined,
},
{
label: "最后回复时间",
value: "LAST_REPLY_TIME",
},
{
Expand Down Expand Up @@ -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
);
Expand Down Expand Up @@ -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 }}
Expand Down

1 comment on commit c55f662

@vercel
Copy link

@vercel vercel bot commented on c55f662 Jan 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

ui – ./

halo-admin-ui.vercel.app
ui-halo-dev.vercel.app
ui-git-main-halo-dev.vercel.app

Please # to comment.