Then I changed the code in main.js. After the build, refreshing the page will not hang, but I don’t know why
let router = new VueRouter({
mode: 'history',
routes: [
{
path: '/',
component: goods
},
{
path: '/goods',
component: goods
},
{
path: '/ratings',
component: ratings
},
{
path: '/seller',
component: seller
}
],
linkActiveClass: 'active'
})
After modification
const routes = [{
path: '/',
redirect: '/goods'
}, {
path: '/goods',
component: goods
}, {
path: '/ratings',
component: ratings
}, {
path: '/seller',
component: seller
}];
const router = new VueRouter({
linkActiveClass: 'active',
routes
});
vue-router document-history backend configuration