diff --git a/pages/tabBar/generateMenu.uts b/pages/tabBar/generateMenu.uts index 85db1e2ea0d9a81c6440003c78e2072e1a41c6eb..d0c72d151c68156651617d79f98112eaeb15208b 100644 --- a/pages/tabBar/generateMenu.uts +++ b/pages/tabBar/generateMenu.uts @@ -1,4 +1,4 @@ -import { pages, groups } from '@/pages.json' +import { pages, groups, subPackages } from '@/pages.json' type Group = { id : string, @@ -28,6 +28,16 @@ export type MenuItem = { items : MenuItem[] } +subPackages.forEach(subPackage => { + (subPackage.pages as UTSJSONObject[]).forEach(page => { + pages.push({ + path: `${subPackage.root}/${page.path}`, + style: page.style as UTSJSONObject, + group: page.group + }) + }) +}) + export function generateMenu(tabBarType : string) : MenuItem[] { let res : MenuItem[] = [] const tabBarPages = JSON.parse(JSON.stringify(pages))!.filter((page : Page) : boolean => page.path.startsWith(tabBarType) && hasPageGroup(page.group)) @@ -159,4 +169,4 @@ function addSetTabBarPage(menuItem : MenuItem) { items: [] } as MenuItem) } -} +}