-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
$slots/useSlots reactivity breaks if same component with different content #6202
Comments
Commenting because we've come across a similar issue/bug since upgrading from |
due to the diff algorithm, you should add unique keys to differentiate these two <Comp3>
<template v-if="data % 2 === 0" #actions>
<Comp key="1">
<template #foo>
{{ data }}
</template>
</Comp>
</template>
<template v-else #actions>
<Comp key="2">
<template #foo>
</template>
</Comp>
</template>
</Comp3> |
Having different content should work without having to use keys. |
Here is a better example. |
Glad to see this closed, but the fix 00036bb seems to break vuepress build. After downgrading vue version to 3.2.37, the error disappeared. Does this change affect template syntax? |
Repro 1 is not resolved by the fix |
Repro 1's root cause is that Workaround example using a manual |
Vue version
3.2.37 | @8edf4b3
Link to minimal reproduction
Repro 1
Repro 2
Steps to reproduce
Changing reactively the template for a slot with the same child component but with different content breaks reactivity of
useSlots
/$slots
/setup contextslots
:What is expected?
The computed calling
slots.foo
should be re-evaluated when the content changes.What is actually happening?
It's not updated and the computed value is stuck.
System Info
No response
Any additional comments?
Related: Slots improvements RFC
The text was updated successfully, but these errors were encountered: