feat: set index after deleting post (#483)
All checks were successful
Build and Deploy / build-and-deploy (push) Has been skipped

This commit is contained in:
Libin YANG 2024-12-20 09:14:56 +08:00 committed by GitHub
parent cf1e7610bd
commit 1d6ab54091
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -73,7 +73,7 @@ export const useStore = defineStore(`store`, () => {
const delPost = (index: number) => {
posts.value.splice(index, 1)
currentPostIndex.value = posts.value.length - 1
currentPostIndex.value = Math.min(index, posts.value.length - 1)
}
watch(currentPostIndex, () => {