Skip to content

Latest commit

 

History

History
 
 

01-setting-up

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

项目设置

首先,你需要 Node.js 和它的打包工具: npm.

Once you've got that working, head to the command line where we'll set up our project.

克隆这个教程到你本地

git clone https://github.com/reactjs/react-router-tutorial
cd react-router-tutorial
cd lessons/01-setting-up
npm install
npm start

现在用浏览器打开 http://localhost:8080

随便浏览一下代码,看看我们是如何使用 webpack 和 npm 脚本来运行这个程序的。

你应该会在浏览器中看到 "Hello React Router" 这句话。

改改代码试试看

打开 modules/App.js 文件,将其中的文本修改成 "Hello " 这之类的。浏览器将根据你的修改自动刷新。


接下来: Rendering a Router