vue2-scrollspy
vue2-scrollspy copied to clipboard
Option to stop clicking on links from updating the hash in the location bar
Describe what you want:
In a project I’m working on, I don’t want the navigation clicks to change the URL. Eg:
URL:
https://example.com/
Navigation link:
<a href="#about">About</a>
After clicking, the viewport is scrolled to the #about
anchor but the URL remains https://example.com/
(hash is not updated/added).
It could be an option on v-scroll-spy-link
:
<ul v-scroll-spy-link="{updateHash: false}">
I know it's late but I'm fairly certain you don't even need to put an href, so if you remove it, it should still work.
@devotoare You’re correct. By removing href
the behaviour is as expected. I’m probably missing something but how does it know where to scroll to without the href
?
@PawelDecowski Honestly not sure, haven't looked at the code very closely. Just figured I could answer the basic question since I tried it. Sorry