-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
fix for #1234, order less greedy routes first #1275
Conversation
CI fails because the order of the routes in |
Hi @pimlie, I see what you mean, however, this PR resolve only your use case. (e.g: |
@alexchopin In my rc3 project the
|
@pimlie What's happening if you go to this URL |
4d08e7c
to
167dba8
Compare
Then it indeed goes to the product component and not the blog. I rewrote the commit to check for segment length within the for loop, now the following route list is generated:
Seems to work better indeed. |
167dba8
to
0d34119
Compare
0d34119
to
19d3912
Compare
@alexchopin if (i === _b.length - 1 && res === 0) {
res = 1
}
Never mind, I got it. To fix the order this should return |
@Atinux Thanks, as long as the issue is resolved I am happy 👍 |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
As it is possible to use dynamic route matching with nuxt, you can get into problems when you have multiple routes that match the same url. See #1234 for an example case.
The vue-router documentation states that:
This commit changes the route sorting behaviour by making sure that less greedy routes are listed before more greedy routes. In this context a less greedy route is defined as having more segments in its path (e.g.
/a/b/c
is less greedy then/a
)