Merge pull request #1246 from sebastiansandqvist/patch-1

Update route.md docs
This commit is contained in:
Leo Horie 2016-08-17 08:38:42 -04:00 committed by GitHub
commit 7718ef4c81

View file

@ -110,12 +110,12 @@ The `view` method is called on every redraw for a matching route. It is similar
`vnode = routeResolve.view(vnode)` `vnode = routeResolve.view(vnode)`
Argument | Type | Required | Description Argument | Type | Required | Description
------------------- | --------------- | --- ------------------- | --------------- | -------- | -----------
`vnode` | `Object` | A [vnode](vnodes.md) whose attributes object contains routing parameters. If the routeResolver does not have a `resolve` method, the vnode's `tag` field defaults to a `div` `vnode` | `Object` | | A [vnode](vnodes.md) whose attributes object contains routing parameters. If the routeResolver does not have a `resolve` method, the vnode's `tag` field defaults to a `div`
`vnode.attrs` | `Object` | A [vnode](vnodes.md) whose attributes object contains routing parameters. If the routeResolver does not have a `resolve` method, the vnode defaults to a `div` `vnode.attrs` | `Object` | | A [vnode](vnodes.md) whose attributes object contains routing parameters. If the routeResolver does not have a `resolve` method, the vnode defaults to a `div`
`vnode.attrs.path` | `String` | The current router path, including interpolated routing parameter values, but without the prefix. Same value as `m.route.get()` `vnode.attrs.path` | `String` | | The current router path, including interpolated routing parameter values, but without the prefix. Same value as `m.route.get()`
`vnode.attrs.route` | `String` | The matched route `vnode.attrs.route` | `String` | | The matched route
**returns** | `Vnode` | Returns a vnode **returns** | `Vnode` | | Returns a vnode
--- ---
@ -293,7 +293,7 @@ Instead of mapping a component to a route, you can specify a RouteResolver objec
m.route(document.body, "/", { m.route(document.body, "/", {
"/": { "/": {
onmatch: function(vnode, resolve) { onmatch: function(vnode, resolve) {
use(Home) resolve(Home)
}, },
view: function(vnode) { view: function(vnode) {
return vnode return vnode