You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am working in a [...slug].vue article and I am trying to replicate the behavior of vue's docs. What I mean by this is that when the user scrolls past a heading, the url hash updates and the part I can't get to work is that when the page is refreshed, it does not jump to the element with the id of the hash in the url, rather it the article reloads in the same position despite the hash in the url.
window.location.hash = 'foo' makes the page jump, using history.replaceState works but when the page is refreshed it always jumps to where the hash is in the article, and not where the user was when they clicked refresh. It works perfect in the vue docs but I can't seem to get this to work.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am working in a
[...slug].vue
article and I am trying to replicate the behavior of vue's docs. What I mean by this is that when the user scrolls past a heading, the url hash updates and the part I can't get to work is that when the page is refreshed, it does not jump to the element with the id of the hash in the url, rather it the article reloads in the same position despite the hash in the url.window.location.hash = 'foo' makes the page jump, using history.replaceState works but when the page is refreshed it always jumps to where the hash is in the article, and not where the user was when they clicked refresh. It works perfect in the vue docs but I can't seem to get this to work.
Beta Was this translation helpful? Give feedback.
All reactions