update readme

This commit is contained in:
dntzhang 2018-11-11 17:14:49 +08:00
parent 50b629d6f7
commit d3f871d7fe
2 changed files with 25 additions and 0 deletions

View File

@ -108,6 +108,18 @@ render(<my-app />, "#container")
| /user/:name | /user/dntzhang | `{ name: 'dntzhang' }` |
| /user/:name/category/:category | /user/dntzhang/category/js | `{ name: 'dntzhang', category: js }` |
## 另一种携带查询参数方法
```html
<li><a href="#/about?name=dntzhang&age=18" >About</a></li>
```
```js
route('/about', (params, query) => {
//点击上面的标签会输出 { name: 'dntzhang', age : '18' }
console.log(query)
})
```
### 地址

View File

@ -107,6 +107,19 @@ render(<my-app />, "#container")
| /user/:name | /user/dntzhang | `{ name: 'dntzhang' }` |
| /user/:name/category/:category | /user/dntzhang/category/js | `{ name: 'dntzhang', category: js }` |
## With Query Parameter
```html
<li><a href="#/about?name=dntzhang&age=18" >About</a></li>
```
```js
route('/about', (params, query) => {
//output { name: 'dntzhang', age : '18' } when click the a tag above
console.log(query)
})
```
## Links
* [DEMO](https://tencent.github.io/omi/packages/omi-router/examples/simple/)