From 61c05cdc66a1a941a048bad5413c000d71d8364e Mon Sep 17 00:00:00 2001
From: Tim <135014430+nagisa77@users.noreply.github.com>
Date: Mon, 7 Jul 2025 13:32:02 +0800
Subject: [PATCH] fix comment link navigation
---
open-isle-cli/src/components/CommentItem.vue | 13 +++++--
open-isle-cli/src/views/PostPageView.vue | 36 ++++++++++++++++++--
2 files changed, 44 insertions(+), 5 deletions(-)
diff --git a/open-isle-cli/src/components/CommentItem.vue b/open-isle-cli/src/components/CommentItem.vue
index 97d8af419..2c0505470 100644
--- a/open-isle-cli/src/components/CommentItem.vue
+++ b/open-isle-cli/src/components/CommentItem.vue
@@ -50,6 +50,7 @@
:key="r.id"
:comment="r"
:level="level + 1"
+ :default-show-replies="r.openReplies"
/>
@@ -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('回复成功')
diff --git a/open-isle-cli/src/views/PostPageView.vue b/open-isle-cli/src/views/PostPageView.vue
index 832463795..4617a3e06 100644
--- a/open-isle-cli/src/views/PostPageView.vue
+++ b/open-isle-cli/src/views/PostPageView.vue
@@ -68,7 +68,14 @@