Vue Router - Change anchor in route on scroll
问题 I am basically trying to have the exact same routing behaviour on my site as here: https://router.vuejs.org/guide/#html. Notice when you scroll down the link changes to https://router.vuejs.org/guide/#javascript. Scroll back up and it is vice versa. When reloading the page your position gets saved. I added the following scroll behavior to my router: scrollBehavior(to, from, savedPosition) { if (to.hash) { return { selector: to.hash } } else if (savedPosition) { return savedPosition; } else {