From bd77d467c35eb81b7948f9bf885bbc3ae31958b0 Mon Sep 17 00:00:00 2001 From: Alex Liu <39984251+Mini-ghost@users.noreply.github.com> Date: Tue, 31 Jan 2023 11:42:46 +0800 Subject: [PATCH] feat: refetch home page when click elk logo (#1129) --- components/common/CommonPaginator.vue | 6 ++++++ components/nav/NavTitle.vue | 12 +++++++++--- nuxt.config.ts | 6 ++++++ 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/components/common/CommonPaginator.vue b/components/common/CommonPaginator.vue index 9ea6c511..9e9dc935 100644 --- a/components/common/CommonPaginator.vue +++ b/components/common/CommonPaginator.vue @@ -43,8 +43,14 @@ defineSlots<{ }>() const { t } = useI18n() +const nuxtApp = useNuxtApp() const { items, prevItems, update, state, endAnchor, error } = usePaginator(paginator, $$(stream), eventType, preprocess) + +nuxtApp.hook('elk-logo:click', () => { + update() + nuxtApp.$scrollToTop() +})