feat(search): enable comment result linking

This commit is contained in:
Tim
2025-07-08 23:16:29 +08:00
parent 7a8b20047e
commit 29e43ae669
3 changed files with 15 additions and 6 deletions

View File

@@ -48,7 +48,8 @@ export default {
text: r.text,
type: r.type,
subText: r.subText,
extra: r.extra
extra: r.extra,
postId: r.postId
}))
return results.value
}
@@ -76,7 +77,9 @@ export default {
} else if (opt.type === 'user') {
router.push(`/users/${opt.id}`)
} else if (opt.type === 'comment') {
// code here
if (opt.postId) {
router.push(`/posts/${opt.postId}#comment-${opt.id}`)
}
}
selected.value = null
keyword.value = ''