File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ React 是 facebook 开源的一套框架,可总结为以下几个特点:
1616- [ 组件通信] ( https://github.com/wscats/react-tutorial/tree/master/react/component/src/communication )
1717- [ 生命周期] ( https://github.com/wscats/react-tutorial/tree/master/react/component/src/lifecycle )
1818- [ 模块化(webpack)] ( https://github.com/wscats/react-tutorial/tree/master/react/webpack )
19+ - [ 脚手架] ( https://github.com/wscats/react-tutorial/tree/master/react/create-react-app )
1920- [ 路由(3.0)] ( https://github.com/wscats/react-tutorial/tree/master/react/router )
2021- Redux
2122 - [ Redux 简介和简单实现] ( https://github.com/wscats/react-tutorial/tree/master/react/redux )
Original file line number Diff line number Diff line change 1+ # 脚手架
2+
3+ 以系统管理员的身份,安装该脚手架全局命令
4+ ``` bash
5+ npm install create-react-app -g
6+ ```
7+
8+ 你就会在全局命令行里面拥有一个` create-react-app ` 命令,可以用以下命令检查是否安装成功
9+ ``` bash
10+ create-react-app -V
11+ ```
12+
13+ 创建第一个项目,如果安装不成功可以考虑换这两个尝试一次` yarn ` 和` cnpm `
14+ ``` bash
15+ create-react-app [项目名字]
16+ create-react-app my-app //例如这样
17+ ```
18+
19+ 启动项目
20+ ``` bash
21+ cd my-app
22+ npm start //或者 npm run start
23+ ```
24+
25+ 在浏览器里面,查看该地址
26+ ``` bash
27+ http://localhost:3000/
28+ ```
29+
30+ ``` bash
31+ public 单页面应用的主页(ico,index.html)
32+ src 开发文件夹(组件,自定义模块,样式,模板)
33+ ```
34+
35+ React 和 Vue 的脚手架都是基于 webpack 的
36+
37+ 其他具体内容也可以参考[ creact react app的官方文档] ( https://github.com/facebook/create-react-app )
You can’t perform that action at this time.
0 commit comments