Skip to content

Slot not updating from nested v-for #3347

Closed
@robertmoura

Description

@robertmoura

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions