Skip to content
This repository was archived by the owner on May 7, 2022. It is now read-only.

Commit 21fbb81

Browse files
committed
文档更新
1 parent ca02a99 commit 21fbb81

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

doc/react.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
采用的是react、redux、webpack3、react-router4的基本架构,属于主流类型。
66

77
**文件夹介绍**
8+
这里我对文件夹结构做了调整,旧版结构是我以前经常使用的,但是当项目越来越大,组件越来越难维护,所以我就升级到新版的结构。
89

10+
旧版的结构
911
```text
1012
├── doc 相关的教程文档
1113
├── public readMe的一些图片资源,可以删掉该文件夹
@@ -30,6 +32,39 @@
3032
└── __snapshots__
3133
```
3234

35+
新版的结构:
36+
```text
37+
├── doc //各种与该项目或者react有关的开发文档供你参考
38+
├── index.html //单页应用的html
39+
├── package.json //node相关环境的配置文件
40+
├── server.js //前端服务器
41+
├── src //项目的主要目录
42+
│   ├── App.js //根react组件
43+
│   ├── AsyncComponent.js //异步react组件HOC
44+
│   ├── actions //action控制中心
45+
│   ├── app.less //公共样式
46+
│   ├── containers //按页面划分组件,每个页面内部的组件在该目录下面管理,公共组件提取到Commons
47+
│   │   ├── BookList
48+
│   │   │   └── BookList.js
49+
│   │   ├── Commons
50+
│   │   ├── Home
51+
│   │   │   ├── Home.js
52+
│   │   │   ├── components
53+
│   │   │   ├── files
54+
│   │   │   └── styles
55+
│   │   └── Search
56+
│   │   ├── Search.js
57+
│   │   ├── components
58+
│   │   └── styles
59+
│   ├── entry.js //webpack打包入口
60+
│   ├── reducers //存放state
61+
│   └── utils //提供一些小工具
62+
├── test //jest测试集
63+
│   ├── __snapshots__
64+
├── webpack.config.js //webpack配置文件
65+
└── webpackServerConfig.js //webpack公共对象
66+
```
67+
3368
虽然react-router4没有了页面路由的概念,但是从项目管理来看,我们还是需要按照页面来管理组件比较合适,这并不冲突。
3469

3570
### 2、修改前端服务器端口号

0 commit comments

Comments
 (0)