From 950b8fc358e0c4970fddc9dcea184f2318c0432c Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Tue, 21 Dec 2021 16:45:31 +0800 Subject: [PATCH] =?UTF-8?q?feature:=20=E6=96=87=E7=AB=A0=E6=BA=A2=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/RecommendPosts.js | 2 +- layouts/BaseLayout.js | 32 +++++++++++++++++--------------- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/components/RecommendPosts.js b/components/RecommendPosts.js index 8ed1ec0b..f3aeb7c1 100644 --- a/components/RecommendPosts.js +++ b/components/RecommendPosts.js @@ -6,7 +6,7 @@ import { useGlobal } from '@/lib/global' * 展示文章推荐 */ const RecommendPosts = ({ recommendPosts }) => { - if (!recommendPosts) { + if (!recommendPosts || recommendPosts.length < 1) { return <> } const { locale } = useGlobal() diff --git a/layouts/BaseLayout.js b/layouts/BaseLayout.js index 948ad096..8738af70 100644 --- a/layouts/BaseLayout.js +++ b/layouts/BaseLayout.js @@ -71,26 +71,28 @@ const BaseLayout = ({ {/* 顶部导航栏 */} -
+
+
-
- -
+
+ +
-
- {onLoading - ? - :
- {children} -
- } -
+
+ {onLoading + ? + : <> + {children} + + } +
- +
+