Problem desription
I am trying to access Vue child components passed in a slot.
I do it with the following approach:
this.$slots.default()
I receive the components and I can even access and call methods of a component using the following approach:
this.$slots.default()[1].type.methods.methodName
The problem is that within the child component this
keyword has now changed to another type where you can only access methods defined in that component and restricted variables. And so for example you can't access this.$refs (which I actually need) or this.$el or anything else except defined methods and some variables.
What I've tried
I've tried assigning this.$refs to a variable within the onmount function and then trying to access it when calling a method from the parent component, but you can't access that variable.
In Vue2 you have full access to the child component and this would work.
Is there a way to fix it in Vue3?