-
{children}
+
{onLoading ? LoadingCover : children}
diff --git a/themes/fukasawa/LayoutBase.js b/themes/fukasawa/LayoutBase.js
index a99dea5d..2c6d030e 100644
--- a/themes/fukasawa/LayoutBase.js
+++ b/themes/fukasawa/LayoutBase.js
@@ -4,6 +4,7 @@ import AsideLeft from './components/AsideLeft'
import Live2D from '@/components/Live2D'
import BLOG from '@/blog.config'
import { isBrowser, loadExternalResource } from '@/lib/utils'
+import { useGlobal } from '@/lib/global'
/**
* 基础布局 采用左右两侧布局,移动端使用顶部导航栏
@@ -20,17 +21,21 @@ import { isBrowser, loadExternalResource } from '@/lib/utils'
* @constructor
*/
const LayoutBase = (props) => {
- const {
- children,
- headerSlot,
- meta
- } = props
+ const { children, headerSlot, meta } = props
const leftAreaSlot =
if (isBrowser()) {
loadExternalResource('/css/theme-fukasawa.css', 'css')
}
+ const { onLoading } = useGlobal()
+
+ const LoadingCover =
+
return (
@@ -41,7 +46,7 @@ const LayoutBase = (props) => {
{headerSlot}
-
{children}
+
{onLoading ? LoadingCover : children}
diff --git a/themes/medium/LayoutBase.js b/themes/medium/LayoutBase.js
index 34f90c96..9d3a9eff 100644
--- a/themes/medium/LayoutBase.js
+++ b/themes/medium/LayoutBase.js
@@ -25,6 +25,13 @@ const LayoutBase = props => {
const { locale } = useGlobal()
const router = useRouter()
const [tocVisible, changeTocVisible] = useState(false)
+ const { onLoading } = useGlobal()
+
+ const LoadingCover =
return (
@@ -42,7 +49,8 @@ const LayoutBase = props => {
{slotTop}
- {children}
+
+ {onLoading ? LoadingCover : children}
{/* 回顶按钮 */}
{
const { children, meta, post } = props
const fullWidth = post?.fullWidth ?? false
+ const { onLoading } = useGlobal()
+ const LoadingCover =
return (
@@ -22,11 +29,9 @@ const LayoutBase = props => {
{/* 顶部导航栏 */}
-
+
- {children}
+ {onLoading ? LoadingCover : children}
diff --git a/themes/simple/LayoutBase.js b/themes/simple/LayoutBase.js
index be0846bd..ec6920d8 100644
--- a/themes/simple/LayoutBase.js
+++ b/themes/simple/LayoutBase.js
@@ -47,12 +47,12 @@ const LayoutBase = props => {
{/* 主体 */}
-
+
{onLoading ? LoadingCover : children}
-
+