82 lines
2.7 KiB
JavaScript
82 lines
2.7 KiB
JavaScript
// src/routes/lazy-components.js
|
||
// 集中管理所有懒加载组件
|
||
|
||
import React from 'react';
|
||
|
||
/**
|
||
* 懒加载组件配置
|
||
* 使用 React.lazy() 实现路由懒加载,大幅减少初始 JS 包大小
|
||
*/
|
||
export const lazyComponents = {
|
||
// Home 模块
|
||
// ⚡ 直接引用 HomePage,无需中间层(静态页面不需要骨架屏)
|
||
HomePage: React.lazy(() => import('@views/Home/HomePage')),
|
||
CenterDashboard: React.lazy(() => import('@views/Dashboard/Center')),
|
||
ProfilePage: React.lazy(() => import('@views/Profile/ProfilePage')),
|
||
// 价值论坛 - 我的积分页面
|
||
ForumMyPoints: React.lazy(() => import('@views/Profile')),
|
||
SettingsPage: React.lazy(() => import('@views/Settings/SettingsPage')),
|
||
Subscription: React.lazy(() => import('@views/Pages/Account/Subscription')),
|
||
PrivacyPolicy: React.lazy(() => import('@views/Pages/PrivacyPolicy')),
|
||
UserAgreement: React.lazy(() => import('@views/Pages/UserAgreement')),
|
||
WechatCallback: React.lazy(() => import('@views/Pages/WechatCallback')),
|
||
|
||
// 社区/内容模块
|
||
Community: React.lazy(() => import('@views/Community')),
|
||
ConceptCenter: React.lazy(() => import('@views/Concept')),
|
||
StockOverview: React.lazy(() => import('@views/StockOverview')),
|
||
LimitAnalyse: React.lazy(() => import('@views/LimitAnalyse')),
|
||
|
||
// 交易模块
|
||
TradingSimulation: React.lazy(() => import('@views/TradingSimulation')),
|
||
|
||
// 事件模块
|
||
EventDetail: React.lazy(() => import('@views/EventDetail')),
|
||
|
||
// 公司相关模块
|
||
CompanyIndex: React.lazy(() => import('@views/Company')),
|
||
ForecastReport: React.lazy(() => import('@views/Company/ForecastReport')),
|
||
FinancialPanorama: React.lazy(() => import('@views/Company/FinancialPanorama')),
|
||
MarketDataView: React.lazy(() => import('@views/Company/MarketDataView')),
|
||
|
||
// Agent模块
|
||
AgentChat: React.lazy(() => import('@views/AgentChat')),
|
||
|
||
// 价值论坛模块
|
||
ValueForum: React.lazy(() => import('@views/ValueForum')),
|
||
ForumPostDetail: React.lazy(() => import('@views/ValueForum/PostDetail')),
|
||
PredictionTopicDetail: React.lazy(() => import('@views/ValueForum/PredictionTopicDetail')),
|
||
|
||
// 数据浏览器模块
|
||
DataBrowser: React.lazy(() => import('@views/DataBrowser')),
|
||
};
|
||
|
||
/**
|
||
* 按需导出单个组件(可选)
|
||
*/
|
||
export const {
|
||
HomePage,
|
||
CenterDashboard,
|
||
ProfilePage,
|
||
ForumMyPoints,
|
||
SettingsPage,
|
||
Subscription,
|
||
PrivacyPolicy,
|
||
UserAgreement,
|
||
WechatCallback,
|
||
Community,
|
||
ConceptCenter,
|
||
StockOverview,
|
||
LimitAnalyse,
|
||
TradingSimulation,
|
||
EventDetail,
|
||
CompanyIndex,
|
||
ForecastReport,
|
||
FinancialPanorama,
|
||
MarketDataView,
|
||
AgentChat,
|
||
ValueForum,
|
||
ForumPostDetail,
|
||
DataBrowser,
|
||
} = lazyComponents;
|