Skip to main content
Version: 3.0 (Current)

多端页面默认工程项目

文件目录

目录约定

目录作用备注
/config配置文件
/docs项目文档
/src源码
/src/api后端api

资源存放平台约定

  • /src 目录下为全局共用资源
  • /src/platforms/mobile 只属于移动端的资源。
  • /src/platforms/mobile/_browser 只属于移动端浏览器端的资源。
  • /src/platforms/mobile/_native 只属于移动端原生app内嵌页面的资源
  • /src/platforms/pc 只属于pc端的资源。
  • /src/platforms/pc/_browser 只属于pc浏览器端的资源。
  • /src/platforms/pc/_native 只属于pc原生app内嵌页面的资源

常见目录名称约定

名字相同,可根据平台,先择存放在不同的平台目录、或页面自己的目录下, 在某一层下面,说明只允许在某一层级下的内容使用, 如只属于某一组件,或某一页面的资源,不需要放到共享里。

目录作用备注
constants常量
hocreact hoc组件
components页面组件
utils幂等的函数纯函数,每次输入保证有相同输出的函数
helpers非幂等的函数非函数,每次输入不保证相同输出的函数或产生了某种副作用的函数
hookshooks
images图片资源
stylescss
locales国际化语言文件
modules页面模块通常一个页面为一个模块

文件目录概览

.
├── README.md
├── config
│   ├── mobile
│   │   ├── _browser
│   │   │   └── config.js
│   │   ├── _native
│   │   │   └── config.js
│   │   ├── bridge
│   │   │   └── bridge-mock-sample.js
│   │   └── template
│   │   └── index.html
│   └── pc
│   ├── _browser
│   │   └── config.js
│   ├── _native
│   │   └── config.js
│   ├── bridge
│   │   └── bridge-mock-sample.js
│   └── template
│   ├── disable-rem.html
│   ├── index.html
│   └── test-pc-flash-screen.html
├── docs
│   ├── docs
│   │   ├── hello
│   │   │   └── index.md
│   │   └── index.md
│   └── public
│   └── images
│   └── dz-logo.jpg
├── globals.d.ts
├── jest.config.ts
├── package.json
├── pnpm-lock.yaml
├── src
│   ├── api
│   │   └── test-api
│   │   └── instance.ts
│   ├── constants
│   │   ├── caches.ts
│   │   └── config.ts
│   ├── global-events.ts
│   ├── helpers
│   │   ├── import-locales.ts
│   │   ├── init-page-query.ts
│   │   ├── react.tsx
│   │   └── static-config.ts
│   ├── hoc
│   │   ├── query-client.tsx
│   │   ├── redux.tsx
│   │   └── top-error-boundary.tsx
│   ├── locales
│   │   ├── en-US.json
│   │   ├── zh-CN.json
│   │   └── zh-TW.json
│   ├── platforms
│   │   ├── mobile
│   │   │   ├── _browser
│   │   │   │   ├── helpers
│   │   │   │   │   ├── generate-page.tsx
│   │   │   │   │   └── multi-platforms.ts
│   │   │   │   ├── hoc
│   │   │   │   │   └── browser.tsx
│   │   │   │   ├── locales
│   │   │   │   │   ├── en-US.json
│   │   │   │   │   ├── zh-CN.json
│   │   │   │   │   └── zh-TW.json
│   │   │   │   └── modules
│   │   │   │   ├── router-demo.entry.tsx
│   │   │   │   └── trade.entry.tsx
│   │   │   ├── _native
│   │   │   │   ├── helpers
│   │   │   │   │   ├── generate-page.tsx
│   │   │   │   │   ├── msg.ts
│   │   │   │   │   ├── multi-platforms.ts
│   │   │   │   │   └── register.ts
│   │   │   │   ├── hoc
│   │   │   │   │   └── native.tsx
│   │   │   │   ├── locales
│   │   │   │   │   ├── en-US.json
│   │   │   │   │   ├── zh-CN.json
│   │   │   │   │   └── zh-TW.json
│   │   │   │   └── modules
│   │   │   │   ├── router-demo.entry.tsx
│   │   │   │   └── trade.entry.tsx
│   │   │   ├── components
│   │   │   │   └── top-error-boundary-fallback
│   │   │   │   ├── index.scss
│   │   │   │   └── index.tsx
│   │   │   ├── constants
│   │   │   │   └── config.ts
│   │   │   ├── customize.ts
│   │   │   ├── helpers
│   │   │   │   └── theme.ts
│   │   │   ├── hoc
│   │   │   │   └── i18n.tsx
│   │   │   ├── hooks
│   │   │   │   ├── use-language.ts
│   │   │   │   ├── use-user-config.ts
│   │   │   │   └── use-user-info.ts
│   │   │   ├── images
│   │   │   ├── locales
│   │   │   │   ├── en-US.json
│   │   │   │   ├── zh-CN.json
│   │   │   │   └── zh-TW.json
│   │   │   ├── model
│   │   │   │   ├── app
│   │   │   │   │   └── slice.ts
│   │   │   │   ├── minimal-store.ts
│   │   │   │   └── subscriber.ts
│   │   │   ├── modules
│   │   │   │   ├── router-demo
│   │   │   │   │   ├── _page-theme.scss
│   │   │   │   │   ├── index.scss
│   │   │   │   │   ├── index.tsx
│   │   │   │   │   ├── locales
│   │   │   │   │   │   ├── en-US.json
│   │   │   │   │   │   ├── zh-CN.json
│   │   │   │   │   │   └── zh-TW.json
│   │   │   │   │   ├── model
│   │   │   │   │   │   ├── hello
│   │   │   │   │   │   │   └── slice.ts
│   │   │   │   │   │   └── store.ts
│   │   │   │   │   ├── pages
│   │   │   │   │   │   ├── detail
│   │   │   │   │   │   │   └── detail.tsx
│   │   │   │   │   │   ├── index
│   │   │   │   │   │   │   ├── index.scss
│   │   │   │   │   │   │   └── index.tsx
│   │   │   │   │   │   └── not-found
│   │   │   │   │   │   └── not-found.tsx
│   │   │   │   │   └── router.tsx
│   │   │   │   └── trade
│   │   │   │   ├── _page-theme.scss
│   │   │   │   ├── index.scss
│   │   │   │   ├── index.tsx
│   │   │   │   ├── locales
│   │   │   │   │   ├── en-US.json
│   │   │   │   │   ├── zh-CN.json
│   │   │   │   │   └── zh-TW.json
│   │   │   │   └── model
│   │   │   │   ├── hello
│   │   │   │   │   └── slice.ts
│   │   │   │   └── store.ts
│   │   │   ├── styles
│   │   │   │   ├── _theme.scss
│   │   │   │   └── index.scss
│   │   │   └── utils
│   │   │   ├── capacities.ts
│   │   │   └── quotes
│   │   │   ├── colors.test.ts
│   │   │   └── colors.ts
│   │   └── pc
│   │   ├── _browser
│   │   │   ├── helpers
│   │   │   │   ├── generate-page.tsx
│   │   │   │   └── multi-platforms.ts
│   │   │   ├── hoc
│   │   │   │   └── browser.tsx
│   │   │   ├── locales
│   │   │   │   ├── en-US.json
│   │   │   │   ├── zh-CN.json
│   │   │   │   └── zh-TW.json
│   │   │   └── modules
│   │   │   ├── router-demo.entry.tsx
│   │   │   └── trade.entry.tsx
│   │   ├── _native
│   │   │   ├── helpers
│   │   │   │   ├── generate-page.tsx
│   │   │   │   ├── msg.ts
│   │   │   │   ├── multi-platforms.ts
│   │   │   │   └── register.ts
│   │   │   ├── hoc
│   │   │   │   └── native.tsx
│   │   │   ├── locales
│   │   │   │   ├── en-US.json
│   │   │   │   ├── zh-CN.json
│   │   │   │   └── zh-TW.json
│   │   │   ├── modules
│   │   │   │   ├── router-demo.entry.tsx
│   │   │   │   └── trade.entry.tsx
│   │   │   └── utils
│   │   │   └── pc-native-config.ts
│   │   ├── components
│   │   │   └── top-error-boundary-fallback
│   │   │   ├── index.scss
│   │   │   └── index.tsx
│   │   ├── constants
│   │   │   └── config.ts
│   │   ├── customize.ts
│   │   ├── helpers
│   │   │   └── theme.ts
│   │   ├── hoc
│   │   │   └── i18n.tsx
│   │   ├── hooks
│   │   │   ├── use-language.ts
│   │   │   ├── use-user-config.ts
│   │   │   └── use-user-info.ts
│   │   ├── images
│   │   ├── locales
│   │   │   ├── en-US.json
│   │   │   ├── zh-CN.json
│   │   │   └── zh-TW.json
│   │   ├── model
│   │   │   ├── app
│   │   │   │   └── slice.ts
│   │   │   ├── minimal-store.ts
│   │   │   └── subscriber.ts
│   │   ├── modules
│   │   │   ├── router-demo
│   │   │   │   ├── _page-theme.scss
│   │   │   │   ├── index.scss
│   │   │   │   ├── index.tsx
│   │   │   │   ├── locales
│   │   │   │   │   ├── en-US.json
│   │   │   │   │   ├── zh-CN.json
│   │   │   │   │   └── zh-TW.json
│   │   │   │   ├── model
│   │   │   │   │   ├── hello
│   │   │   │   │   │   └── slice.ts
│   │   │   │   │   └── store.ts
│   │   │   │   ├── pages
│   │   │   │   │   ├── detail
│   │   │   │   │   │   └── detail.tsx
│   │   │   │   │   ├── index
│   │   │   │   │   │   ├── index.scss
│   │   │   │   │   │   └── index.tsx
│   │   │   │   │   └── not-found
│   │   │   │   │   └── not-found.tsx
│   │   │   │   └── router.tsx
│   │   │   └── trade
│   │   │   ├── _page-theme.scss
│   │   │   ├── index.scss
│   │   │   ├── index.tsx
│   │   │   ├── locales
│   │   │   │   ├── en-US.json
│   │   │   │   ├── zh-CN.json
│   │   │   │   └── zh-TW.json
│   │   │   └── model
│   │   │   ├── hello
│   │   │   │   └── slice.ts
│   │   │   └── store.ts
│   │   ├── styles
│   │   │   ├── _theme.scss
│   │   │   └── index.scss
│   │   └── utils
│   │   ├── capacities.ts
│   │   └── quotes
│   │   ├── colors.test.ts
│   │   └── colors.ts
│   ├── styles
│   │   ├── _normalize.scss
│   │   └── index.scss
│   ├── types.ts
│   └── utils
│   ├── capacities.ts
│   ├── logout.ts
│   ├── platfom-indepent
│   │   └── user-config.ts
│   ├── platforms.ts
│   └── react-utils.ts
└── tsconfig.json

103 directories, 160 files