#1187·vue-router

Need a way to set what scroll position is saved

Author: brad426Created Feb 22, 2017Updated Jul 12, 2025
Labelsfeature requestneeds RFC

Similar to the way you can define a scrollBehavior function on a router instance, I need a way to define how the savedPosition value gets computed/populated. I need to override the default behavior which stores the window's scroll position, and instead store the scroll position of another element.

My application uses a structure where the document/window stays static, and content scrolls inside of a container. Example: http://codepen.io/brad426/pen/pezRge