perf: 优化各 Tab 数据加载为按需请求
MarketDataView (股票行情): - 初始只加载 summary + tradeData(2个接口) - funding/bigDeal/unusual/pledge 数据在切换 Tab 时按需加载 - 新增 loadDataByType 方法支持懒加载 FinancialPanorama (财务全景): - 初始只加载 stockInfo + metrics + comparison + mainBusiness(4个接口) - 从9个接口优化到4个接口 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -31,6 +31,8 @@ import {
|
||||
HStack,
|
||||
Text,
|
||||
Spacer,
|
||||
Center,
|
||||
Spinner,
|
||||
} from '@chakra-ui/react';
|
||||
import type { ComponentType } from 'react';
|
||||
import type { IconType } from 'react-icons';
|
||||
@@ -311,7 +313,18 @@ const SubTabContainer: React.FC<SubTabContainerProps> = memo(({
|
||||
return (
|
||||
<TabPanel key={tab.key} p={0}>
|
||||
{shouldRender && Component ? (
|
||||
<Suspense fallback={null}>
|
||||
<Suspense
|
||||
fallback={
|
||||
<Center py={20}>
|
||||
<Spinner
|
||||
size="lg"
|
||||
color={DEEP_SPACE.textGold}
|
||||
thickness="3px"
|
||||
speed="0.8s"
|
||||
/>
|
||||
</Center>
|
||||
}
|
||||
>
|
||||
<Component {...componentProps} />
|
||||
</Suspense>
|
||||
) : null}
|
||||
|
||||
Reference in New Issue
Block a user