From eaa1c13664b2eb9114cdd8c14553a28e419e24e3 Mon Sep 17 00:00:00 2001 From: Gilbert Date: Thu, 6 Dec 2018 17:30:43 -0600 Subject: [PATCH] Show how to use each routing strategy in docs (#2332) --- docs/route.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/route.md b/docs/route.md index a93199c59..573ea23ca 100644 --- a/docs/route.md +++ b/docs/route.md @@ -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.