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