mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-03-04 19:10:47 +08:00
fix: 添加 onActivated 钩子以刷新帖子和评论
This commit is contained in:
@@ -166,7 +166,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed, onMounted, onBeforeUnmount, nextTick, watch, watchEffect } from 'vue'
|
||||
import { ref, computed, onMounted, onBeforeUnmount, nextTick, watch, watchEffect, onActivated } from 'vue'
|
||||
import VueEasyLightbox from 'vue-easy-lightbox'
|
||||
import { useRoute } from 'vue-router'
|
||||
import CommentItem from '~/components/CommentItem.vue'
|
||||
@@ -746,6 +746,11 @@ const gotoProfile = () => {
|
||||
navigateTo(`/users/${author.value.id}`, { replace: true })
|
||||
}
|
||||
|
||||
onActivated(async () => {
|
||||
await refreshPost()
|
||||
await fetchComments()
|
||||
})
|
||||
|
||||
onMounted(async () => {
|
||||
await fetchComments()
|
||||
const hash = location.hash
|
||||
|
||||
Reference in New Issue
Block a user