Closed yoshi-pi closed 10 months ago
https://router.vuejs.org/guide/advanced/scroll-behavior.html
const router = createRouter({ scrollBehavior(to, from, savedPosition) { // always scroll 10px above the element #main return { // could also be // el: document.getElementById('main'), el: '#main', top: -10, } }, })
The top property should be 10, considering #2027.
The top property is -10.
No response
Don’t open duplicates please. The behavior won’t be changed as it would break everyone’s code and there is no reason to
Reproduction
https://router.vuejs.org/guide/advanced/scroll-behavior.html
Steps to reproduce the bug
Expected behavior
The top property should be 10, considering #2027.
Actual behavior
The top property is -10.
Additional information
No response