refactor: 重构 RouterContainer 组件以支持懒加载页面模块

- 移除不必要的 Suspense 组件,改为使用 LoadedPage 组件进行懒加载。
- 更新特性获取逻辑,使用 getFeatureByKey 函数替代直接查找。
- 新增 featureMeta.ts 文件,集中管理功能配置和相关方法。
- 实现 pageLoaders 以支持按需加载页面模块,提升性能和用户体验。
This commit is contained in:
2026-06-30 22:45:32 +08:00
parent d18ae5d41c
commit c7f4305fc3
17 changed files with 159 additions and 68 deletions
+1 -3
View File
@@ -19,13 +19,11 @@ describe('features', () => {
expect(feature).toHaveProperty('label');
expect(feature).toHaveProperty('description');
expect(feature).toHaveProperty('defaultVisible');
expect(feature).toHaveProperty('component');
expect(feature).not.toHaveProperty('component');
expect(typeof feature.key).toBe('string');
expect(typeof feature.label).toBe('string');
expect(typeof feature.description).toBe('string');
expect(typeof feature.defaultVisible).toBe('boolean');
expect(feature.component).toBeDefined();
expect(['function', 'object']).toContain(typeof feature.component);
if (feature.key !== 'dashboard') {
expect(feature).toHaveProperty('icon');