-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
ComponentExposed seems to be completely empty #11459
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This comment was marked as outdated.
This comment was marked as outdated.
So instead of |
|
Okay interesting, this issue here recommends using it: vuejs/language-tools#3206 |
Vue version
3.4.34
Link to minimal reproduction
https://play.vuejs.org/#eNqFU01v2zAM/SuEMCApkNjY2pPnBNiGHDagW9HlVhVDYNOOOlkSJNlL4Pm/j5LztWJrDwZIPvLxkZR79sGYpGuRZSx3hRXGg0PfGpAbVS84846zJVeiMdp66MFiNYN7rGCAyuoGJlQ7OeG3+0+6MQckSUc30J9T/N4g8QRAK1R+tTPaYXnJNy+O4Dxkz7coDVo3eX+hQ6tb3Sr/d2HI4KrQynlo9qQyC1Lz573ywKqrg9ol/AbVSrmERZhuGuyrwHNqMZ1ewWIJPVcAgVxLTKSup7FF0m1ki8kbDEUDfXk67pG2Ro7HxsiNR/IA8sN+qA2tNpZzBlmlNbkPPYgyg7cwzGi+YL6D4ZHwlGrz9IKIzegsJKQSdfLktKLbRW2chcUJifab8YKEcpaNqgO2kVL/+hJj3rY4O8aLLRY//xF/crsQ4+zOokPbIWcnzG9sjX6EV9+/4o7sE9jospWU/QJ4j7TENmgc0z62qiTZF3lR7ed4baHqtVvtPCp3HCoIDZlDzOeMbh8W+7/Rz3Kvk5tYR6eiLZ7f50vPH2pUaEVB7jr+DCVWQuGd1cblsQcdMIP1wyOxLqevPIFSdNEg00A3r7QNbbY0JAgVmKhF38MYGYY8NWNdOhY+fwg/OvozaGAagGZLrm/Y8AeQ1kpf
Steps to reproduce
When trying to type the template ref of a component defined with a generic, we're told to use
ComponentExpose
(https://vuejs.org/api/sfc-script-setup#generics). This seems to "work" in the sense that it doesn't throw TS errors likeInstanceType
does, but the type itself is completely empty and useless.For example,
myRef.value
has no properties anymore, so you can't really use it practically speaking.In the repro you can see that
.$el
doesn't exist on the type for example, whereas it really does exist of course.What is expected?
The full type to be returned of the component instance.
What is actually happening?
Nothing is returned in the type and the IDE also doesn't know what to do with it (no autocomplete for example).
System Info
No response
Any additional comments?
No response
The text was updated successfully, but these errors were encountered: