Xaviius
Xaviius

Reputation: 25

vuejs adds always # in the URL

im using VueJS and FullpageJS for my website. Somehow the website adds always an anchor like this:

I enter asdf at the end of the URL and instead of the 404 page I get the landingpage with an added #.

I already checked the whole code if i did any obvious mistakes, which I didnt.

Like this will be this.


router.js:

import Vue from 'vue';
import Router from 'vue-router';
import Landingpage from '@/components/Landingpage';
import Terms from '@/components/Terms';
import LegalNotice from '@/components/LegalNotice';
import Errorpage from '@/components/Error'
Vue.use(Router)

export default new Router({
    routes: [
        {
            path: '/',
            name: 'Landingpage',
            component: Landingpage
        },
        {
            path: '/terms',
            name: 'Terms',
            component: Terms
        },
        {
            path: '/legal',
            name: 'LegalNotice',
            component: LegalNotice
        },
        {
            path: '*',
            name: 'Error',
            component: Errorpage
        }
    ]
})


I appreciate any idea.
Thank you.

Upvotes: 1

Views: 400

Answers (1)

Rich
Rich

Reputation: 562

You want to use history mode if you don’t want a # in the url

Upvotes: 3

Related Questions