Page 壳层
用 Page、PageTitle、PageContent 包裹界面。Dialog 与 Sheet 必须嵌在 PageContent 内,不能作为 Page 的兄弟节点。
TSXpage
1import {
2 Page,
3 PageContent,
4 PageNavTitle,
5 PageTitle,
6} from "@quan-erp/shared-ui";
7import metadata from "../../module.metadata.json" with { type: "json" };
8
9export default function ExamplePage() {
10 return (
11 <Page
12 pluginName={metadata.name}
13 navMenu={{ menuTitle: <PageNavTitle>Title</PageNavTitle>, leadingBackButton: true }}
14 bottomNav={{ visible: true }}
15 >
16 <PageTitle>{/* title + actions */}</PageTitle>
17 <PageContent>
18 {/* tables, forms, Dialogs */}
19 </PageContent>
20 </Page>
21 );
22}注册路由
路径需以 /${metadata.name} 为前缀。标准布局用 AppRegistry.route.add,空白/公开布局用 AppRegistry.rootRoute.add。
共享 UI
优先使用 @quan-erp/shared-ui 组件(Button、Form、Input、EmptyState、LoadingState)。表单使用 react-hook-form + zod + FormField / FormMessage。