You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.0 KiB
37 lines
1.0 KiB
|
1 month ago
|
/**
|
||
|
|
* pages 统一导出
|
||
|
|
*
|
||
|
|
* 这个目录用于存放复杂的业务页面组件
|
||
|
|
*
|
||
|
|
* 目录结构建议:
|
||
|
|
* pages/
|
||
|
|
* ├── index.ts # 统一导出
|
||
|
|
* ├── TestPage/ # 测试页面
|
||
|
|
* │ ├── index.tsx # 页面主组件
|
||
|
|
* │ ├── components/ # 页面私有组件
|
||
|
|
* │ └── styles.ts # 页面样式
|
||
|
|
* ├── ProfilePage/ # 个人资料页面
|
||
|
|
* └── SettingsPage/ # 设置页面
|
||
|
|
*
|
||
|
|
* 使用方式:
|
||
|
|
* 1. 在 pages/ 目录下创建页面组件
|
||
|
|
* 2. 在 app/ 目录下创建路由文件,引用 pages/ 中的组件
|
||
|
|
* 3. 从这里统一导出,方便管理
|
||
|
|
*
|
||
|
|
* 示例:
|
||
|
|
* ```typescript
|
||
|
|
* // pages/TestPage/index.tsx
|
||
|
|
* export default function TestPage() {
|
||
|
|
* return <View>...</View>;
|
||
|
|
* }
|
||
|
|
*
|
||
|
|
* // app/test.tsx
|
||
|
|
* import TestPage from '@/pages/TestPage';
|
||
|
|
* export default TestPage;
|
||
|
|
* ```
|
||
|
|
*/
|
||
|
|
|
||
|
|
// 导出业务页面组件
|
||
|
|
export { default as TestPage } from './TestPage';
|
||
|
|
|