From 24d8ddcee522643c22439c4101af12d8309859c9 Mon Sep 17 00:00:00 2001 From: LiuJiaNan <15703339975@163.com> Date: Mon, 1 Jun 2026 08:28:26 +0800 Subject: [PATCH] =?UTF-8?q?feat(Page):=20=E6=B7=BB=E5=8A=A0loading?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Page/index.d.ts | 2 ++ src/components/Page/index.js | 47 ++++++++++++++++++---------------- 2 files changed, 27 insertions(+), 22 deletions(-) diff --git a/src/components/Page/index.d.ts b/src/components/Page/index.d.ts index 1e1aac7..fe0bd42 100644 --- a/src/components/Page/index.d.ts +++ b/src/components/Page/index.d.ts @@ -16,6 +16,8 @@ export interface PageProps { isShowFooter?: boolean; /** 是否显示头部和底部组件,默认 true */ isShowAllAction?: boolean; + /** 是否处于加载状态,默认 false */ + loading?: boolean; /** 取消按钮文字,默认 "关闭" */ backButtonText?: string; /** 内容区域的padding,默认 "20px" */ diff --git a/src/components/Page/index.js b/src/components/Page/index.js index ca75dca..a023b4e 100644 --- a/src/components/Page/index.js +++ b/src/components/Page/index.js @@ -1,4 +1,4 @@ -import { Button, Space } from "antd"; +import { Button, Space, Spin } from "antd"; import { useEffect, useState } from "react"; import { throttle } from "throttle-debounce"; import HeaderBack from "../HeaderBack"; @@ -14,6 +14,7 @@ function Page(props) { headerPrevious = true, isShowFooter = true, isShowAllAction = true, + loading = false, backButtonText = "关闭", contentPadding = "20px", customActionButtons, @@ -47,29 +48,31 @@ function Page(props) { }, [isShowAllAction, isShowFooter]); return ( -