docs: update Practical Projects for dva@2 (#7505)

This commit is contained in:
chencheng (云谦) 2017-09-08 09:51:31 +08:00 committed by Benjy Cui
parent 421feb1c84
commit e1efb82dcb
2 changed files with 6 additions and 6 deletions

View File

@ -13,12 +13,12 @@ Include the following:
## Install dva-cli ## Install dva-cli
Install dva-cli with npm, and make sure the version is larger than `0.7.0`. Install dva-cli with npm, and make sure the version is larger than `0.8.1`.
```bash ```bash
$ npm install dva-cli -g $ npm install dva-cli -g
$ dva -v $ dva -v
0.7.0 0.8.1
``` ```
## Create New App ## Create New App
@ -94,7 +94,7 @@ Add routing information to router, edit `router.js`:
```diff ```diff
+ import Products from './routes/Products'; + import Products from './routes/Products';
... ...
+ <Route path="/products" component={Products} /> + <Route path="/products" exact component={Products} />
``` ```
Then open http://localhost:8000/#/products in your browser, you should be able to see the `<h2>` tag defined before. Then open http://localhost:8000/#/products in your browser, you should be able to see the `<h2>` tag defined before.

View File

@ -13,12 +13,12 @@ title: 项目实战
## 安装 dva-cli ## 安装 dva-cli
通过 npm 安装 dva-cli 并确保版本是 `0.7.0` 或以上。 通过 npm 安装 dva-cli 并确保版本是 `0.8.1` 或以上。
```bash ```bash
$ npm install dva-cli -g $ npm install dva-cli -g
$ dva -v $ dva -v
0.7.0 0.8.1
``` ```
## 创建新应用 ## 创建新应用
@ -94,7 +94,7 @@ export default Products;
```diff ```diff
+ import Products from './routes/Products'; + import Products from './routes/Products';
... ...
+ <Route path="/products" component={Products} /> + <Route path="/products" exact component={Products} />
``` ```
然后在浏览器里打开 http://localhost:8000/#/products ,你应该能看到前面定义的 `<h2>` 标签。 然后在浏览器里打开 http://localhost:8000/#/products ,你应该能看到前面定义的 `<h2>` 标签。