From ae0e3531e0814ae948e42d27474ae98c6c9eae0c Mon Sep 17 00:00:00 2001 From: vayci Date: Fri, 13 Jan 2023 13:55:22 +0800 Subject: [PATCH 1/2] feat: update comment list sorter --- src/modules/contents/comments/CommentList.vue | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/modules/contents/comments/CommentList.vue b/src/modules/contents/comments/CommentList.vue index 9c74318c1..457d1582b 100644 --- a/src/modules/contents/comments/CommentList.vue +++ b/src/modules/contents/comments/CommentList.vue @@ -213,7 +213,7 @@ const ApprovedFilterItems: { label: string; value?: boolean }[] = [ }, ]; -type Sort = "LAST_REPLY_TIME" | "REPLY_COUNT" | "CREATE_TIME"; +type Sort = "" | "LAST_REPLY_TIME" | "REPLY_COUNT" | "CREATE_TIME"; const SortFilterItems: { label: string; @@ -221,6 +221,10 @@ const SortFilterItems: { }[] = [ { label: "默认", + value: "", + }, + { + 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 !== "" || selectedUser.value || keyword.value ); @@ -358,7 +362,7 @@ function handleClearFilters() { 排序:{{ selectedSortFilterItem.label }} From 7e446aad30ad7ba5cf344bea4c8a965241579d6c Mon Sep 17 00:00:00 2001 From: vayci Date: Fri, 13 Jan 2023 15:48:42 +0800 Subject: [PATCH 2/2] feat: update comment list sorter --- src/modules/contents/comments/CommentList.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/modules/contents/comments/CommentList.vue b/src/modules/contents/comments/CommentList.vue index 457d1582b..3d46d3839 100644 --- a/src/modules/contents/comments/CommentList.vue +++ b/src/modules/contents/comments/CommentList.vue @@ -213,7 +213,7 @@ const ApprovedFilterItems: { label: string; value?: boolean }[] = [ }, ]; -type Sort = "" | "LAST_REPLY_TIME" | "REPLY_COUNT" | "CREATE_TIME"; +type Sort = "LAST_REPLY_TIME" | "REPLY_COUNT" | "CREATE_TIME"; const SortFilterItems: { label: string; @@ -221,7 +221,7 @@ const SortFilterItems: { }[] = [ { label: "默认", - value: "", + value: undefined, }, { label: "最后回复时间", @@ -287,7 +287,7 @@ function handleClearKeyword() { const hasFilters = computed(() => { return ( selectedApprovedFilterItem.value.value !== undefined || - selectedSortFilterItem.value.value !== "" || + selectedSortFilterItem.value.value !== undefined || selectedUser.value || keyword.value ); @@ -362,7 +362,7 @@ function handleClearFilters() { 排序:{{ selectedSortFilterItem.label }}