From fd7afd8131f8e7d84e67a5066f59dbb211b0a137 Mon Sep 17 00:00:00 2001 From: mashirozx Date: Sun, 1 Aug 2021 00:38:49 +0800 Subject: [PATCH] Fix navigation --- app/functions.php | 2 +- src/@types/declarations.d.ts | 9 ++- .../lists/postThumbList/PostThumbList.vue | 76 +++++++++++++++---- src/hooks/useKeepAliveWindowScrollTop.ts | 6 +- 4 files changed, 77 insertions(+), 16 deletions(-) diff --git a/app/functions.php b/app/functions.php index 8500532..6167c2f 100644 --- a/app/functions.php +++ b/app/functions.php @@ -5,7 +5,7 @@ define('SAKURA_VERSION', wp_get_theme()->get('Version')); define('SAKURA_TEXT_DOMAIN', wp_get_theme()->get('TextDomain')); -define('SAKURA_DEVEPLOMENT', false); +define('SAKURA_DEVEPLOMENT', true); define('SAKURA_DEVEPLOMENT_HOST', 'http://127.0.0.1:9000'); // PHP loaders diff --git a/src/@types/declarations.d.ts b/src/@types/declarations.d.ts index 1e91008..8bdbb63 100644 --- a/src/@types/declarations.d.ts +++ b/src/@types/declarations.d.ts @@ -131,4 +131,11 @@ interface CommentStore { } } -declare type FetchingStatus = 'inite' | 'cached' | 'pending' | 'success' | 'error' | 'empty' +declare type FetchingStatus = + | 'inite' + | 'cached' + | 'pending' + | 'success' + | 'error' + | 'empty' + | 'noMore' diff --git a/src/components/lists/postThumbList/PostThumbList.vue b/src/components/lists/postThumbList/PostThumbList.vue index 9ae351d..e75f124 100644 --- a/src/components/lists/postThumbList/PostThumbList.vue +++ b/src/components/lists/postThumbList/PostThumbList.vue @@ -10,13 +10,21 @@
-
no more
- +
{{ lastPageMessage }}
+ @@ -164,5 +206,13 @@ export default defineComponent({ > .loader__wrapper { padding-top: 24px; } + > .last-page__wrapper { + color: #989898; + font-size: 15px; + padding: 50px 0 20px 0; + } + > .navigation-bar__wrapper { + width: 100%; + } } diff --git a/src/hooks/useKeepAliveWindowScrollTop.ts b/src/hooks/useKeepAliveWindowScrollTop.ts index 3e4807a..c10de66 100644 --- a/src/hooks/useKeepAliveWindowScrollTop.ts +++ b/src/hooks/useKeepAliveWindowScrollTop.ts @@ -17,7 +17,11 @@ export default function () { }) onActivated(() => { - window.scrollTo(scrollLeft.value ?? 0, scrollTopCache.value) + window.scrollTo({ + top: scrollLeft.value ?? 0, + behavior: 'smooth', + }) + // window.scrollTo(scrollLeft.value ?? 0, scrollTopCache.value) setIsScrollTopSet(true) })