make note about default prefix in router #1176

This commit is contained in:
Leo Horie 2016-08-03 17:36:08 -04:00
parent 1c014e15a3
commit 1fd9cf4271

View file

@ -7,6 +7,7 @@
- [Component `controller` function](#component-controller-function)
- [Component arguments](#component-arguments)
- [Passing components to `m()`](#passing-components-to-m)
- [`m.route` mode](#mroute-mode)
- [`m.route` and anchor tags](#mroute-and-anchor-tags)
- [Reading/writing the current route](#readingwriting-the-current-route)
- [Accessing route params](#accessing-route-params)
@ -177,6 +178,10 @@ m("div", component);
m("div", m(component));
```
## `m.route` mode
`m.route.mode` was replaced by `m.route.prefix(prefix)` where `prefix` can be `#`, `?`, `` (for "pathname" mode). The new API also supports hashbang (`#!`), which is the default, and it supports non-root pathnames and arbitrary mode variations such as querybang (`?!`)
## `m.route()` and anchor tags
Handling clicks on anchor tags via the mithril router is similar to `v0.2.x` but uses a new lifecycle method and API.