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