-
-
Notifications
You must be signed in to change notification settings - Fork 8.9k
Closed
Description
Vue version
3.2.37 | @8edf4b3
Link to minimal reproduction
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 context slots
:
<script setup>
import { ref } from 'vue'
import Comp from './Comp.vue'
import Comp3 from './Comp3.vue'
const data = ref(0)
setInterval(() => {
data.value++
}, 1000)
</script>
<template>
<h1>{{ data }}</h1>
<!-- BUG? Doesn't update properly -->
<Comp3>
<template v-if="data % 2 === 0" #actions>
<Comp>
<template #foo>
{{ data }}
</template>
</Comp>
</template>
<template v-else #actions>
<Comp>
<template #foo>
</template>
</Comp>
</template>
</Comp3>
</template>
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
Metadata
Metadata
Assignees
Labels
No labels