-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
beforeRouteEnter
hook's next callback invoked with wrong instance
#1874
Comments
Certainly something top investigate - in the meantime, applying a key to the router-view make it work again: <router-view :key="$route.path"></router-view> Definitely has something to do with the transition, but I can't say what for the moment. |
@LinusBorg: Thanks for the quick answer! Unfortunately, |
@LinusBorg I have the same problem, is there any update? |
You would read about it here if there was. |
I also created a live demo: https://jsfiddle.net/hj1pbgfw/2/ , when I using
|
@LinusBorg thanks for your quick reply, do you planning to fix it? |
Sure, when someone finds time to pick up the task. I won't as I don't know the internals that are involved well enough to debug it in a reasonable timeframe. |
Well, 4 months have passed, I will make a PR if I can fix it, thanks. |
**What kind of change does this PR introduce?** (check at least one) - [x] Bugfix - [ ] Feature - [ ] Code style update - [ ] Refactor - [ ] Build-related changes - [ ] Other, please describe: **Does this PR introduce a breaking change?** (check one) - [ ] Yes - [x] No If yes, please describe the impact and migration path for existing applications: **The PR fulfills these requirements:** - [x] It's submitted to the `dev` branch for v2.x (or to a previous version branch), _not_ the `master` branch - [x] When resolving a specific issue, it's referenced in the PR's title (e.g. `fix #xxx[,#xxx]`, where "xxx" is the issue number) - [x] All tests are passing: https://github.com/vuejs/vue/blob/dev/.github/CONTRIBUTING.md#development-setup - [ ] New/updated tests are included If adding a **new feature**, the PR's description includes: - [ ] A convincing reason for adding this feature (to avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it) **Other information:** This is a PR for #1874 , cc: @LinusBorg
Version
3.0.1
Reproduction link
https://codepen.io/Nirazul/pen/GOrjVW?editors=1010
Steps to reproduce
Follow these instructions to reproduce the issue:
You should see that "$data" is empty.
It doesn't matter where you start as long as you follow the above order at some point. The behaviour is normal, when you leave out the second or third step.
What is expected?
The route succeeds in fetching the correct data in any order of navigation.
What is actually happening?
When I follow the pages in the order described in the reproduction steps section, the router fails to load one of the pages.
It most definitely has something to do with the transition mode "out-in". When I remove the attribute or use "in-out", everything seems to work normally.
The text was updated successfully, but these errors were encountered: