From 08c08e20ff58b8794ae8ee998fa77a2efa6ce073 Mon Sep 17 00:00:00 2001 From: afc163 Date: Mon, 7 Jul 2025 20:33:25 +0800 Subject: [PATCH] feat: add skeleton loading state to app layout --- src/app.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app.tsx b/src/app.tsx index d7aa4f6c..f88c0681 100644 --- a/src/app.tsx +++ b/src/app.tsx @@ -7,6 +7,8 @@ import { history, Link } from '@umijs/max'; import defaultSettings from '../config/defaultSettings'; import { errorConfig } from './requestErrorConfig'; import { currentUser as queryCurrentUser } from './services/ant-design-pro/api'; +import { Skeleton } from 'antd'; + const isDev = process.env.NODE_ENV === 'development'; const loginPath = '/user/login'; @@ -101,7 +103,9 @@ export const layout: RunTimeLayoutConfig = ({ initialState, setInitialState }) = // unAccessible:
unAccessible
, // 增加一个 loading 的状态 childrenRender: (children) => { - // if (initialState?.loading) return ; + if (initialState?.loading) { + return ; + } return ( <> {children}