Referencing useTemplateRef
value inside computed
and using computed
in template results in TS error
#5022
Labels
useTemplateRef
value inside computed
and using computed
in template results in TS error
#5022
Vue - Official extension or vue-tsc version
2.1.10
VSCode version
1.95.3
Vue version
3.5.13
TypeScript version
5.4.5
System Info
package.json dependencies
No response
Steps to reproduce
'field' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer. ts-plugin(7022)
What is expected?
Using
ref
you can do something like this:What is actually happening?
Simply replacing
ref
withuseTemplateRef
doesn't work in this case.A feasible workaround in this case could be something like this:
The question is if this is just an implementation/TypeScript limitation or if something can be done to make this work with
useTemplateRef
.Link to minimal reproduction
No response
Any additional comments?
No response
The text was updated successfully, but these errors were encountered: