From 901ff413a7dec0ee2e16a2dc915b71b45a79d69a Mon Sep 17 00:00:00 2001 From: Konstantin Ladutenko Date: Wed, 8 Dec 2021 14:39:25 +0300 Subject: [PATCH] Update scroll-behavior.md According to https://github.com/vuejs/vue-router/blob/dev/examples/scroll-behavior/app.js#L21 history mode is a must (and in recent Vue CLI with vue-router in hash mode custom scrollBahavior doesn't work) --- docs/guide/advanced/scroll-behavior.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guide/advanced/scroll-behavior.md b/docs/guide/advanced/scroll-behavior.md index 037329426..42c68ee20 100644 --- a/docs/guide/advanced/scroll-behavior.md +++ b/docs/guide/advanced/scroll-behavior.md @@ -4,7 +4,7 @@ When using client-side routing, we may want to scroll to top when navigating to a new route, or preserve the scrolling position of history entries just like real page reload does. `vue-router` allows you to achieve these and even better, allows you to completely customize the scroll behavior on route navigation. -**Note: this feature only works if the browser supports `history.pushState`.** +**Note: this feature only works if the browser supports `history.pushState` and the router uses [HTML5 history mode](../essentials/history-mode.md).** When creating the router instance, you can provide the `scrollBehavior` function: