Skip to content

Commit

Permalink
Show how to use each routing strategy in docs (#2332)
Browse files Browse the repository at this point in the history
  • Loading branch information
gilbert authored and dead-claudia committed Dec 6, 2018
1 parent e068bd4 commit eaa1c13
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/route.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,9 @@ Routing without page refreshes is made partially possible by the [`history.pushS

The routing strategy dictates how a library might actually implement routing. There are three general strategies that can be used to implement a SPA routing system, and each has different caveats:

- Using the [fragment identifier](https://en.wikipedia.org/wiki/Fragment_identifier) (aka the hash) portion of the URL. A URL using this strategy typically looks like `http://localhost/#!/page1`
- Using the querystring. A URL using this strategy typically looks like `http://localhost/?/page1`
- Using the pathname. A URL using this strategy typically looks like `http://localhost/page1`
- `m.route.prefix('#!')` (default) – Using the [fragment identifier](https://en.wikipedia.org/wiki/Fragment_identifier) (aka the hash) portion of the URL. A URL using this strategy typically looks like `http://localhost/#!/page1`
- `m.route.prefix('?')`Using the querystring. A URL using this strategy typically looks like `http://localhost/?/page1`
- `m.route.prefix('')`Using the pathname. A URL using this strategy typically looks like `http://localhost/page1`

Using the hash strategy is guaranteed to work in browsers that don't support `history.pushState`, because it can fall back to using `onhashchange`. Use this strategy if you want to keep the hashes purely local.

Expand Down

0 comments on commit eaa1c13

Please sign in to comment.