vue-router 4.1.2 无法匹配所有请求路径
按照官方给的404例子写的路由
const routes = [{ path: '/:pathMatch(.*)*', name: 'Index', component: Index }]
const router = createRouter({
history: createWebHistory(),
routes,
})
当我访问/a/b/c时是可以正常跳转的,当路径中包含.就无法跳转,比如/a.txt
官方文档:router.vuejs.org/zh/guide/essentia...
github上有一个相似的问题:github.com/vuejs/router/issues/121...
直接在最后路由配置
path:'/*'
试试