fix comment link navigation

This commit is contained in:
Tim
2025-07-07 13:32:02 +08:00
parent ba368f7bd7
commit 61c05cdc66
2 changed files with 44 additions and 5 deletions

View File

@@ -50,6 +50,7 @@
:key="r.id"
:comment="r"
:level="level + 1"
:default-show-replies="r.openReplies"
/>
</div>
</div>
@@ -72,10 +73,14 @@ const CommentItem = {
level: {
type: Number,
default: 0
},
defaultShowReplies: {
type: Boolean,
default: false
}
},
setup(props) {
const showReplies = ref(false)
const showReplies = ref(props.defaultShowReplies)
const showEditor = ref(false)
const isWaitingForReply = ref(false)
const toggleReplies = () => {
@@ -114,8 +119,10 @@ const CommentItem = {
time: new Date(r.createdAt).toLocaleDateString('zh-CN', { month: 'numeric', day: 'numeric' }),
avatar: r.avatar,
text: r.content,
reply: []
}))
reply: [],
openReplies: false
})),
openReplies: false
})
showEditor.value = false
toast.success('回复成功')