Skip to content

Static Slots optimization combined with component instance re-use can lead to stale slot content never being updated. [EDGE CASE] #2893

@Jokcy

Description

@Jokcy

Version

3.0.4

Reproduction link

https://codesandbox.io/s/demo-for-sfc-slots-issue-n27kc

Steps to reproduce

You can see Hello never change to World.

I already find the reason is that SFC compiler add { _: 1 } to the compiled slots, which in updateSlots tell Vue there is no need to update instance.slots. But in this case, it work not correctly.

What is expected?

Hello and World switch in 1 second

What is actually happening?

never update

Metadata

Metadata

Assignees

No one assigned

    Labels

    🔨 p3-minor-bugPriority 3: this fixes a bug, but is an edge case that only affects very specific usage.has workaroundA workaround has been found to avoid the problemscope: slots

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions