Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Typings for $refs should also include Component | Component #9854
Steps to reproduce
What is expected?
I expect the
What is actually happening?
I get a message that the type of
Here is a screenshot of the actual error I am getting in production code:
This issue came across because I need to access a nested element within a Vue component when writing in TypeScript. In native JS, I can simply query the DOM of the Vue component using
When you log
I propose that the typings for
@underfin That will work, but only in cases where the ref actually points to an actual named component (which is my case, so your suggestion works 100% for me)
In this case, we can't know the actual component that will be used in place, and therefore have to use a generic
You typing should be
Thanks for all your help! I've learned that: