Skip to content
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

Abstract history mode doesn't fire afterEach hooks when using router.go() #3250

Closed
sirlancelot opened this issue Jul 1, 2020 · 1 comment
Projects

Comments

@sirlancelot
Copy link
Contributor

Version

3.3.4

Reproduction link

https://codepen.io/sirlancelot/pen/wvMPeZj?editors=1011

Steps to reproduce

  1. Open Reproduction (Ensure CodePen's Console is open)
  2. In the Output Window, click the "One" link
  3. Observe that the afterEach hook fires ("Navigate / -> /one" is emitted in the Console)
  4. In the Output Window, click the "Back" link

What is expected?

  • The afterEach hooks should fire when router.go() is used.
  • "Navigate /one -> /" should be emitted in the Console.

What is actually happening?

afterEach hooks are not firing. Nothing is emitted in the Console.

@posva
Copy link
Member

posva commented Jul 1, 2020

This was introduced in 3.3.0 and could be from this change: #2292
It should also be a good first issue. If anybody wants to submit a PR and there isn't one yet, please do

sirlancelot added a commit to sirlancelot/vue-router that referenced this issue Jul 7, 2020
Move afterHooks in to confirmTransition so that they will be called
even in abstract routing mode. Note that with this patch, hooks
attached via router.onReady will now fire *before* router.afterEach but
the the docs do not describe a specific execution order of these hooks.
@posva posva added this to Long term road (high prio, low complex) in Longterm Aug 31, 2020
@posva posva closed this as completed in 4da7021 Sep 24, 2020
@posva posva moved this from Long term road (high prio, low complex) to Done in Longterm Sep 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging a pull request may close this issue.

2 participants