// ★ 模块注册表 -- 扩展点核心 // 用 import.meta.glob 约定式收集每个子模块的 index.js, // 自动生成统一的项目列表。新增项目页签 = 新建 modules/<新项目>/ 文件夹, // 无需改动导航/路由代码。 // // 每个模块 index.js 默认导出形如: // { // id: 'mobile-game', // 唯一标识,同时用作路由 path // tabKey: 'tabs.mobileGame', // i18n 键,用于页签标题 // order: 1, // 页签排序 // component: () => import('./MobileGame.vue') // 懒加载组件 // } const moduleFiles = import.meta.glob('./*/index.js', { eager: true }) const modules = Object.values(moduleFiles) .map((mod) => mod.default) .filter(Boolean) .sort((a, b) => (a.order ?? 99) - (b.order ?? 99)) export default modules