Skip to content

Vue Router Redirection issue on page reload #1717

@SasanFarrokh

Description

@SasanFarrokh

Version

2.7.0

Reproduction link

https://jsfiddle.net/chrisvfritz/50wL7mdz/

Steps to reproduce

This is my paths:

new VueRouter({
     
        ...
        mode: 'history',
        routes: [

               { path: '/', component: Dashboard, name: 'home' },

               { path: '/widgets', component: Widgets },

               { path: '/tables/simple-tables', component: Tables },

       ]

})

Everything is normal and good
When i visit two segments path like: '/tables/simple-tables' directly from browser , it will redirect to homepage

this only happens in history mode
it only happens to two segments paths
it only happens when i enter address directly to browser or refresh the current route

What is expected?

Visit '/tables/simple-tables' by typing in address bar
Or go to that url and refresh the browser

What is actually happening?

it wil redirected to home page
address: '/'

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions