mirror of
https://github.com/doocs/md.git
synced 2025-01-22 20:04:39 +08:00
feat: set index after deleting post (#483)
All checks were successful
Build and Deploy / build-and-deploy (push) Has been skipped
All checks were successful
Build and Deploy / build-and-deploy (push) Has been skipped
This commit is contained in:
parent
cf1e7610bd
commit
1d6ab54091
@ -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, () => {
|
||||
|
Loading…
Reference in New Issue
Block a user