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

Setup function called multiple times with router-view and keep-alive #1953

Closed
mibiio opened this issue Aug 7, 2023 · 2 comments
Closed

Setup function called multiple times with router-view and keep-alive #1953

mibiio opened this issue Aug 7, 2023 · 2 comments

Comments

@mibiio
Copy link

mibiio commented Aug 7, 2023

Reproduction

https://stackblitz.com/edit/quasarframework-2jj1tx?file=src%2Frouter%2Froutes.js

Steps to reproduce the bug

  1. Click appOne
  2. Click appChildOne -> setup function called 2 times for appChildOne
  3. Click appTwo
  4. Click appChildOne -> setup function called 3 times for appChildOne
  5. From this point on, all setup functions in all childs are called 3 times

Expected behavior

The setup function should be called exactly one time for each component.

Actual behavior

What happened?

When using keep-alive with router-views the setup function is called multiple times.
Following structure:

-MainLayout
 -AppPage
  -AppOnePage
    -ChildOne
    -ChildTwo
    -ChildThree
  -AppTwoPage
    -ChildOne
    -ChildTwo
    -ChildThree
  -AppThreePage
    -ChildOne
    -ChildTwo
    -ChildThree

The problem is that the setup function of all Child pages is called more often than once.

Additional information

No response

@mibiio mibiio changed the title Setup function called multiple times with router-views and keep-alive Setup function called multiple times with router-view and keep-alive Aug 7, 2023
@posva
Copy link
Member

posva commented Aug 7, 2023

Duplicate of #626

@posva posva marked this as a duplicate of #626 Aug 7, 2023
@posva posva closed this as not planned Won't fix, can't repro, duplicate, stale Aug 7, 2023
@posva
Copy link
Member

posva commented Aug 7, 2023

Please, search existing issues and pull requests before opening issues, it saves maintainers a lot of time 🙏

@vuejs vuejs locked and limited conversation to collaborators Aug 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants