How to click on the a tag in the vue page without changing the route?

The

a tag has a paragraph anchor, that is, one click will jump to the specified paragraph of the current page. The problem is that after clicking the a tag, the route of the page will change. If the page is refreshed at this time, the page will be lost. Because the current route has been changed to a paragraph anchor bound by the a tag, rather than a formally registered route, is there any way to solve it?
sample code:

<template>
    <aside>
        <nav>
            <a href="-sharpabc">abc</a>
        </nav>
    </aside>
    <section id="abc">abc</section>
</template>
May.14,2021

use history mode, not hash mode


use js to scroll windows or vue use history mode


you can listen for refresh page events, and then reset the route to the regular route you want
https://codeshelper.com/q/10.

.
Menu