-
-
Notifications
You must be signed in to change notification settings - Fork 5k
Description
Version
3.5.1
Reproduction link
https://jsfiddle.net/chrisvfritz/50wL7mdz/
Steps to reproduce
Router enters home "/" first then another route at history mode on browser refresh or direct enter.
When hit http://localhost:8080/page, it goes to http://localhost:8080/ and after http://localhost:8080/page
How to prevent this?
const routes = [
{
path: '/home',
name: 'Home',
component: () => import('../views/Home.vue'),
},
{
path: '/page',
name: 'page',
component: () => import('../views/Page.vue'),
}
]
const router = new VueRouter({
mode: 'history',
base: process.env.BASE_URL,
routes,
});
What is expected?
Router enters home "/" first then another route at history mode on browser refresh or direct enter.
When hit http://localhost:8080/page, it goes to http://localhost:8080/ and after http://localhost:8080/page
How to prevent this?
const routes = [
{
path: '/home',
name: 'Home',
component: () => import('../views/Home.vue'),
},
{
path: '/page',
name: 'page',
component: () => import('../views/Page.vue'),
}
]
const router = new VueRouter({
mode: 'history',
base: process.env.BASE_URL,
routes,
});
What is actually happening?
Router enters home "/" first then another route at history mode on browser refresh or direct enter.
When hit http://localhost:8080/page, it goes to http://localhost:8080/ and after http://localhost:8080/page
How to prevent this?
const routes = [
{
path: '/home',
name: 'Home',
component: () => import('../views/Home.vue'),
},
{
path: '/page',
name: 'page',
component: () => import('../views/Page.vue'),
}
]
const router = new VueRouter({
mode: 'history',
base: process.env.BASE_URL,
routes,
});