feat(SubTabContainer): 支持自定义 Suspense fallback
- SubTabConfig 添加 fallback 属性 - 财务全景/盈利预测配置骨架屏 fallback - 解决点击 Tab 先显示 Spinner 再显示骨架屏的问题 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -4,10 +4,14 @@
|
||||
* - Tab 配置
|
||||
*/
|
||||
|
||||
import { lazy } from 'react';
|
||||
import React, { lazy } from 'react';
|
||||
import { Building2, Brain, TrendingUp, Wallet, FileBarChart, Newspaper } from 'lucide-react';
|
||||
import type { CompanyTheme, TabConfig } from './types';
|
||||
|
||||
// 骨架屏组件(同步导入,用于 Suspense fallback)
|
||||
import { FinancialPanoramaSkeleton } from './components/FinancialPanorama/components';
|
||||
import { ForecastSkeleton } from './components/ForecastReport/components';
|
||||
|
||||
// ============================================
|
||||
// 黑金主题配置
|
||||
// ============================================
|
||||
@@ -89,12 +93,14 @@ export const TAB_CONFIG: TabConfig[] = [
|
||||
name: '财务全景',
|
||||
icon: Wallet,
|
||||
component: FinancialPanorama,
|
||||
fallback: React.createElement(FinancialPanoramaSkeleton),
|
||||
},
|
||||
{
|
||||
key: 'forecast',
|
||||
name: '盈利预测',
|
||||
icon: FileBarChart,
|
||||
component: ForecastReport,
|
||||
fallback: React.createElement(ForecastSkeleton),
|
||||
},
|
||||
{
|
||||
key: 'tracking',
|
||||
|
||||
Reference in New Issue
Block a user