Using a router.scrollBehavior.js file does not seem to work. If I include my scroll behavior as a function in my config file, as an option of router, it works. If include it as a file as detailed in the documentation it does not work.
What’s more confusing is that in the example (https://github.com/nuxt/nuxt.js/tree/dev/packages/vue-app/template) there is a router.js file and router.scrollBehavior.js is imported.
Is this a bug, or is the documentation incorrect?
- nuxt: v2.14.12
- node: v12.18.3
Steps to reproduce
Basic nuxt setup, create a router.scrollBehavior.js file
What is Expected?
Forcing the scroll position to the top for every route
What is actually happening?
Page does not scroll