create a function and give a route path as a parameter in this function if the path is same to the route path then use window.scrollTo function and pass a object.
const handleSamePageNavigation = (event, path) => {
if (route.path === path) {
event.preventDefault();
window.scrollTo({ top: 0, behavior: "smooth" });
}
};
and use this function where you use any link like:
<NuxtLink
to="/about-us"
@click="
(e) =>handleSamePageNavigation(e, localePath('/about-us'))">
About
</NuxtLink>