You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use this component twice. Once with content in the default slot, once without. After the component is mounted, trigger any update to its data:
<template><div><div>{{ updateTrigger }}</div><times-rendered></times-rendered><times-rendered>
Any content in the default slot causes a re-render. Why?
</times-rendered></div></template><script>exportdefault{data: ()=>({updateTrigger: false}),asyncmounted(){awaitthis.$nextTick()this.updateTrigger=true},};</script>
What is expected?
I would expect each instance of the component to only render once.
What is actually happening?
The component with content in the slot renders twice.
I'm not actually sure whether this is a bug or a feature request. Maybe this is expected behavior currently. If it is, then I guess this would be better classified as a feature request.
The text was updated successfully, but these errors were encountered:
Version
2.5.16
Reproduction link
https://codepen.io/JosephSilber/pen/KeWjzr
Description
Passing content in a slot causes the component to re-render when the parent re-renders, even if the component's data hasn't changed.
Steps to reproduce
Create a simple component that shows the amount of times it's been rendered:
Use this component twice. Once with content in the default slot, once without. After the component is mounted, trigger any update to its data:
What is expected?
I would expect each instance of the component to only render once.
What is actually happening?
The component with content in the slot renders twice.
I'm not actually sure whether this is a bug or a feature request. Maybe this is expected behavior currently. If it is, then I guess this would be better classified as a feature request.
The text was updated successfully, but these errors were encountered: