Watching changes on slots list? #10525
Unanswered
Namidas
asked this question in
Help/Questions
Replies: 2 comments
-
a quick example... |
Beta Was this translation helpful? Give feedback.
0 replies
-
Not entirely sure about performance, but using an inline function seems to work alright, and the multitude of re-renders I was getting this way ended up being a Quasar ScrollArea compo bug rather than a Vüe3 thing. Still would like to find a propper way to keep track of slots names |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I'm dinamically injecting slots into dynamic child components using something like this...
(on the parent compo)
then I use it like this...
(I'm keeping a reactive object with compo slots by name, by looking through $slots in parent component checking names against the pattern "{compoName}:{compoSlot}")
it works perfectly as long as the slots are there on parent compo mount, but if they're conditionally rendered like below, they won't work...
How can I keep track of changes in the list of slots ?
I've tried (I believe) everything, watching $slots (can't do that), keeping "component_slots" as a computed, etc...but nothing works since $slots seems to be a proxy, but not reactive...
Keep in mind that I've simplified the template code a lot out of memory, there are probably errors there, but the fact remains the same that, programatically can't find a way of keeping track of Object.keys(this.$slots) (so to speak)
The only thing that worked for me is putting that logic inside a method and calling it inline on the component template...but on the other hand it forces the component to re-render on stuff as simple as mouse hover...
Any thoughts on this? Something I'm getting wrong?
Thanks in advance ñ____n
Beta Was this translation helpful? Give feedback.
All reactions