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