-
-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Catch-all rules [...param] should end with a star * #412
Comments
This could be documented and it’s possible with |
Thanks for the tip! Only difference with |
@posva I tried to use
My guess is this is an escaping issue. |
Wouldn’t 2 be a vite bug? I can’t test it |
I'm not sure, I would need to debug. The message quoted above is found in browser console. That doesn't look like the right URL for the browser to fetch a file named So my guess at the moment is that unplugin-vue-router should generate a route with How are other escapes handled, for example if I name my file |
No worries, the help is already appreciated! |
Naming your file
[...path].vue
generates the router path:path(.*)
.This is documented here: https://uvr.esm.is/guide/file-based-routing.html#catch-all-404-not-found-route
Vue Router documentation recommends using a repeated regex for catch-all routes, i.e.
:path(.*)*
(note extra star at the end).See: https://router.vuejs.org/guide/essentials/dynamic-matching#Catch-all-404-Not-found-Route
There difference is subtle but observable.
First: the
path
parameter is a string"/a/b/c"
with unplugin, and a parsed array["a", "b", "c"]
with router syntax.Second: I would like to navigate to a catch-all route with a specific URL. It's impossible to do with unplugin, consider this:
The text was updated successfully, but these errors were encountered: