如果路由参数包含 dot(.),vue 会将路由重定向到 404。在 vue 2 中,我们可以在 webpack 中使用以下规则允许/处理路由器参数中的点:
devServer: {
historyApiFallback: {
disableDotRule: true
}
}
Run Code Online (Sandbox Code Playgroud)
但vue 3使用vite而不是webpack。现在如何处理参数中的点?
路线示例如下:
{
path: your-route/:params",
component: somecomponent,
}
Run Code Online (Sandbox Code Playgroud)