You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Having a [...slug] page in a subdirectory (let's say blog/[...slug].vue had higher priority than other routes that were defined in the same directory
For example I have blog/index.vue and blog/[...slug].vue, visiting http://localhost:3000/blog always renders blog/[...slug].vue.
Non-dynamic routes should have higher priority than dynamic routes like [...slug].
Just to mention, if I move index.vue and [...slug].vue out of the subdirectory and place them inside pages dir, it works as expected.
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered:
Yes, this a vue-router bug. Note routes like /blog/:id? and /blog/:id* will still have a higher priority than /blog because in that case the path /blog matches both but order does not depend on the path that is being matched. It solely depends on the giving path pattern (e.g. /blog/:id). In practice, with full control of the router, one could avoid this with /blog/:slug(.+) but I understand that's not how [...slug] works.
Environment
Reproduction
https://stackblitz.com/edit/nuxt-starter-r2xyxg
Describe the bug
Having a
[...slug]
page in a subdirectory (let's sayblog/[...slug].vue
had higher priority than other routes that were defined in the same directoryFor example I have
blog/index.vue
andblog/[...slug].vue
, visitinghttp://localhost:3000/blog
always rendersblog/[...slug].vue
.Non-dynamic routes should have higher priority than dynamic routes like
[...slug]
.Just to mention, if I move
index.vue
and[...slug].vue
out of the subdirectory and place them insidepages
dir, it works as expected.Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: