Feature Request: Allow named slots to be reactive #716
eric-g-97477
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a playground.
According to https://github.com/orgs/vuejs/discussions/6096, the default slot is reactive. A watcher can be setup which will trigger when they change.
However, this does not work with named slots.
I tried writing:
but when the
foo
slot appears or disappears, the watch is not triggered.There is at least one workaround that Burrito provided on the discord channel.
https://discord.com/channels/325477692906536972/568340117052456970/1301267865386618952
It involved creating a composable which used onBeforeUpdate to watch for changes and provide reactivity.
I assume this is the only / best solution. However, I am always interested in learning about alternative solutions.
My preference would be to use a watcher which would be triggered as the named slots change.
Beta Was this translation helpful? Give feedback.
All reactions