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

Slot not updating from nested v-for #3347

Closed
robertmoura opened this issue Mar 3, 2021 · 1 comment · Fixed by #3353
Closed

Slot not updating from nested v-for #3347

robertmoura opened this issue Mar 3, 2021 · 1 comment · Fixed by #3353
Labels

Comments

@robertmoura
Copy link

Version

3.0.7

Reproduction link

https://codesandbox.io/s/vue-3-slot-bug-6hj9c

Steps to reproduce

Click the buttons and compare the expected with actual behaviour.

What is expected?

The slot should update the visible content to the results in the computed.

What is actually happening?

The slot isn't updating.


It took me a long time to figure out what might be causing this bug. It seems to be the combination of a few different things:

  1. The hierarchical data in the computed isn't deeply reactive
  2. The v-for is used on the "First" component and the default slot has elements that need updating
  3. The "First" component uses the "Second" component to encapsulate the slot
  4. There's a slot that is v-if'ed in the "First" component
@edison1105
Copy link
Member

a tip here:
return false in shouldUpdateComponent()
maybe patchFlag is incorrect.
too busy to look into deep.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants