Skip to content

Lifecycle broken with nested keep-alive components #3882

@sqal

Description

@sqal

Vue.js version

2.0.1

Reproduction Link

https://jsfiddle.net/uyt4tzak/1/

Steps to reproduce

  1. Open reproduction link
  2. Go to /auth/register
  3. Play with step buttons, in console you'll see components are correctly activated/deactivated
  4. Click on the login button, you'll be redirected to home view (/) and in console you'll see that Auth/Login/Register components are properly destroyed, except components inside Register component. Their destroyed hook isn't called.

What is Expected?

Dynamic component inside nested <keep-alive> component should be always properly destroyed.

In my case, after redirecting from /auth/register to / you should see following logs in the console:

Auth component destroyed
Login component destroyed
Register component destroyed
destroyed step X

What is actually happening?

Destroyed hook in Step component is never called, which means that component itself is never destroyed.

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