mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-06-07 18:47:44 +08:00
feat: allow logo to refresh home page
This commit is contained in:
@@ -112,7 +112,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, watch } from 'vue'
|
||||
import { ref, watch, onMounted, onBeforeUnmount } from 'vue'
|
||||
import ArticleCategory from '~/components/ArticleCategory.vue'
|
||||
import ArticleTags from '~/components/ArticleTags.vue'
|
||||
import CategorySelect from '~/components/CategorySelect.vue'
|
||||
@@ -397,6 +397,18 @@ const fetchContent = async (reset = false) => {
|
||||
}
|
||||
}
|
||||
|
||||
const refreshHome = () => {
|
||||
fetchContent(true)
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
window.addEventListener('refresh-home', refreshHome)
|
||||
})
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
window.removeEventListener('refresh-home', refreshHome)
|
||||
})
|
||||
|
||||
useScrollLoadMore(fetchContent)
|
||||
|
||||
watch([selectedCategory, selectedTags], () => {
|
||||
|
||||
Reference in New Issue
Block a user