mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-02-23 14:40:49 +08:00
fix: 已经加载的帖子 重新进入 没有执行评论定位逻辑 #652
This commit is contained in:
@@ -876,12 +876,7 @@ const gotoProfile = () => {
|
||||
navigateTo(`/users/${author.value.id}`, { replace: true })
|
||||
}
|
||||
|
||||
onActivated(async () => {
|
||||
await refreshPost()
|
||||
await fetchComments()
|
||||
})
|
||||
|
||||
onMounted(async () => {
|
||||
const initPage = async () => {
|
||||
await fetchComments()
|
||||
const hash = location.hash
|
||||
const id = hash.startsWith('#comment-') ? hash.substring('#comment-'.length) : null
|
||||
@@ -889,6 +884,14 @@ onMounted(async () => {
|
||||
updateCurrentIndex()
|
||||
window.addEventListener('scroll', updateCurrentIndex)
|
||||
jumpToHashComment()
|
||||
}
|
||||
|
||||
onActivated(async () => {
|
||||
await initPage()
|
||||
})
|
||||
|
||||
onMounted(async () => {
|
||||
await initPage()
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user