const routes = [
{
path: '*',
redirect: '/home'
},
{
path: '/home',
name: 'Home',
component: Home
},
{
path: '/about',
name: 'About',
// route level code-splitting
// this generates a separate chunk (about.[hash].js) for this route
// which is lazy-loaded when the route is visited.
component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
}
]
不是说通配符*应该放到最后吗,根据路由规则,我如果输入''/about'',应该会被通配符匹配,跳转到/home,可是我试了下,里路由还是可以正常跳转到/about