From: Eduardo San Martin Morote Date: Fri, 11 Sep 2020 11:32:34 +0000 (+0200) Subject: docs: hash encoding X-Git-Tag: v4.0.0-beta.10~31 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=57be9827df2347e512194245fec2291e8540f473;p=thirdparty%2Fvuejs%2Frouter.git docs: hash encoding --- diff --git a/docs/guide/migration/index.md b/docs/guide/migration/index.md index 7691e164..29de3689 100644 --- a/docs/guide/migration/index.md +++ b/docs/guide/migration/index.md @@ -90,10 +90,10 @@ Decoded values are now consistent no matter where the navigation is initiated (o Given any [normalized route location](/api/#routelocationnormalized): - Values in `path`, `fullPath` are not decoded anymore. They will appear as provided by the browser (modern browsers provide them encoded). e.g. directly writing on the address bar `https://example.com/hello world` will yield the encoded version: `https://example.com/hello%20world` and both `path` and `fullPath` will be `/hello%20world`. -- `hash` is now decoded, that way it can be copied over: `router.push({ hash: $route.hash })`. +- `hash` is now decoded, that way it can be copied over: `router.push({ hash: $route.hash })` and be used directly in [scrollBehavior](/api/#scrollbehavior)'s `el` option. - When using `push`, `resolve` and `replace` and providing a `string` location or a `path` property in an object, **it must be encoded**. On the other hand, `params`, `query` and `hash` must be provided in its unencoded version. -**Reason**: This allows to easily copy existing properties of a location when calling `router.push()` and `router.resolve()`. Learn more about encoding [in the cookbook](#TODO). +**Reason**: This allows to easily copy existing properties of a location when calling `router.push()` and `router.resolve()`, make it consistent across browsers. Learn more about encoding [in the cookbook](#TODO). ## Breaking Changes: API Changes