mirror of
https://github.com/doocs/md.git
synced 2025-02-02 19:27:46 +08:00
feat: update post slider
This commit is contained in:
parent
828b92ac21
commit
8cc1f48140
@ -77,10 +77,12 @@ section {
|
||||
position: relative;
|
||||
margin: 0 -20px;
|
||||
width: 375px;
|
||||
min-height: 100vh;
|
||||
padding: 20px;
|
||||
font-size: 14px;
|
||||
box-sizing: border-box;
|
||||
outline: none;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
.preview table {
|
||||
|
@ -40,7 +40,7 @@ function renamePost() {
|
||||
}
|
||||
store.renamePost(editTarget.value, renamePostInputVal.value)
|
||||
isOpenEditDialog.value = false
|
||||
toast.success(`文章更名成功`)
|
||||
toast.success(`文章重命名成功`)
|
||||
}
|
||||
|
||||
const isOpenDelPostConfirmDialog = ref(false)
|
||||
@ -105,9 +105,9 @@ function delPost() {
|
||||
<DropdownMenuContent>
|
||||
<DropdownMenuItem @click.stop="startRenamePost(index)">
|
||||
<Edit3 class="mr-2 size-4" />
|
||||
更名
|
||||
重命名
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuItem @click.stop="startDelPost(index)">
|
||||
<DropdownMenuItem v-if="store.posts.length > 1" @click.stop="startDelPost(index)">
|
||||
<Trash class="mr-2 size-4" />
|
||||
删除
|
||||
</DropdownMenuItem>
|
||||
|
@ -73,7 +73,7 @@ export const useStore = defineStore(`store`, () => {
|
||||
|
||||
const delPost = (index: number) => {
|
||||
posts.value.splice(index, 1)
|
||||
currentPostIndex.value = 0
|
||||
currentPostIndex.value = posts.value.length - 1
|
||||
}
|
||||
|
||||
watch(currentPostIndex, () => {
|
||||
|
Loading…
Reference in New Issue
Block a user