Question about useSlots() - not reactive? #6096
-
i need to access the slots content in script setup to count the children of the default slot.
And within template just But i recognize a difference in both. In template $slots seems to be reactive when slot content changes (example change from 4 to 3 children in slot). The value updates. But useSlots seems not to be reactive. I don't get it running to get the update when slot content gets added or removed. i tried to use a ref, i tried to use a computed, it looks like i can only access the initial value on component setup but no further updates when slot content changes. Is this difference expected? How would i need to handle it? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You can use like this Example, Hope this helps you. new.mp4 |
Beta Was this translation helpful? Give feedback.
You can use like this Example, Hope this helps you.
new.mp4