From 1fb4c82e1f2c7892aebd039dcdeae56555ba25d6 Mon Sep 17 00:00:00 2001 From: Takagi <1103069291@qq.com> Date: Tue, 26 Mar 2024 16:50:07 +0800 Subject: [PATCH] fix: selecting the previous post leads to a negative page (#5594) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #### What type of PR is this? /kind bug /area ui #### What this PR does / why we need it: 修复当选中首个文章设置时,点击上一个还可以继续修改 `page` 的问题。 #### How to test it? 测试选中首个文章设置之后,点击上一个是否不再修改 `page` 值 #### Which issue(s) this PR fixes: Fixes #5475 #### Does this PR introduce a user-facing change? ```release-note 修复在文章列表设置中可以无限点击上一个的问题 ``` --- ui/console-src/modules/contents/posts/PostList.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/console-src/modules/contents/posts/PostList.vue b/ui/console-src/modules/contents/posts/PostList.vue index 1f68d49e09..6a51793ec6 100644 --- a/ui/console-src/modules/contents/posts/PostList.vue +++ b/ui/console-src/modules/contents/posts/PostList.vue @@ -197,7 +197,7 @@ const handleSelectPrevious = async () => { selectedPost.value = previousPost; return; } - if (index === 0 && hasPrevious) { + if (index === 0 && hasPrevious.value) { page.value--; await refetch(); selectedPost.value = posts.value[posts.value.length - 1].post;