Skip to content

beforeRouteUpdate next() fires too early when re-visiting routes within "out-in" transition #1372

Closed
@henwen

Description

@henwen

Version

2.5.2

Reproduction link

https://jsfiddle.net/hwdearborn/y9xqgz1c/4/

Steps to reproduce

  1. Click "to /", you will see "This is A"
  2. Click 'to B", you will see "This is B"
  3. Click 'to /" or use Back Button, you will see "This is"

Also note the console logs, which show how the order of the next() callback is different on the return visit (Step 3 above)

What is expected?

Without the "out-in" option on the transition, beforeRouteEnter's next() callback is fired after Component A is mounted, and its data is properly set.

What is actually happening?

With the "out-in" option on the transition, beforeRouteEnter's next() callback is fired before Component A's beforeCreate event, causing the data to get overriden with its default (empty) value


I came across this issue while trying to add an out-in transition to the Fetching Before Navigation
example from the docs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions