In my component, I've installed a dependency called vue2-smooth-scroll that allows me to scroll to my target element based on its id. This is the code to achieve that:
<a href="#test" class="mouse-icon" @click.prevent="preventDefault" v-smooth-scroll>
I was able to scroll to the element, with an id of #test as shown in the following code
<div id="test"></div>
However, I notice that the id "test" will be appended at the end of the URL. how do you stop that from happening? For example,
<div><a href="javascript:void(0);" onclick="window.scroll(0,1);">click here</a></div>preventDefaultmethod? Because you're calling this method with @click?vue2-smooth-scroll. You probably have to modify the plugin itself.