-
-
Notifications
You must be signed in to change notification settings - Fork 5k
router.getMatchedComponents() doesn't seem to match alias #1488
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
Comments
Note: the following works (some kind of internal logic bug?) export function createRouter () {
return new Router({
mode: 'history',
routes: [
{
path: '/index.html',
component: Home,
alias: '/'
},
{
path: '/hello.html',
component: Hello
}
]
})
} So when '/' is the alias of '/index.html' it seems to work, rather than the reverse. |
You can provide a github repo as a repo, but make sure to boil it down, please 🙂 |
Seems like related to / duplicate of #1427 |
I thought so too, but it looks like he gets the opposite effect |
Closing due to inactivity. Please open a new issue with a reference to this one if you can follow up with more information. |
This bug has been fixed in version 2.6.0: 8e30c34 |
Version
2.5.3
Reproduction link
https://codepen.io/matthewdean/pen/PjoeJw
Steps to reproduce
I have this router:
I'm using SSR to render Vue pages. However, when debugging, I've found that getMatchedComponents() only works with the main path, not the alias. So for this:
... when
context.url
is '/' it renders my home component. Whencontext.url
is '/index.htmlthen matchedComponents is
[undefined]`.What is expected?
For getMatchedComponents() to match '/
and
/index.html`.What is actually happening?
It's not doing that.
The text was updated successfully, but these errors were encountered: