I'm using vueRouter on the site, but I ran into a problem. If I want to click between hashes, scrollBehavior doesn't work for me.
if you click on the Bio page on "noubtest.com" and try to go to "services" only the url will change but you won't get to the correct section in the Bio.
https://noubtest.com/home -> https://noubtest.com/home#fifthPage
Navigation
<router-link v-show="!mobile" class="link bio" :to="{ name: 'Home', hash: '#firstPage' }">Bio</router-link>
<router-link v-show="!mobile" class="link link2" :to="{ name: 'Home', hash: '#fifthPage' }">Services</router-link>
Router - index.js
import VueRouter from "vue-router";
Vue.use(VueRouter);
const routes = [
{
path: "/home",
name: "Home",
component: Home,
meta: {
title: "Bio",
requiresAuth: false,
},
},
const router = new VueRouter({
mode: "history",
routes,
scrollBehavior() {
return { x: 0, y: 0 };
},
});
I'm a newbie, could you please guide me on how to fix this? so that I can move between sections on one page using the menu?
I also use the fullpage.js module on the website (but it probably won't be a problem)