Skip to content
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

v-for is not supported with useTemplateRef #4932

Open
quantix-dev opened this issue Oct 20, 2024 · 0 comments · May be fixed by #4933
Open

v-for is not supported with useTemplateRef #4932

quantix-dev opened this issue Oct 20, 2024 · 0 comments · May be fixed by #4933
Labels
bug Something isn't working 🔨 p3-minor-bug

Comments

@quantix-dev
Copy link

Vue - Official extension or vue-tsc version

2.1.6

VSCode version

1.94.2

Vue version

3.5.12

TypeScript version

5.6.3

System Info

No response

package.json dependencies

No response

Steps to reproduce

  1. In a component template add any element with a v-for
  2. Add a ref and use useTemplateRef in the script tag
  3. The type will correctly infer for ONE single element but not account for the v-for

The vuejs docs provide an example of useTemplateRef with a v-for here which suffers from this issue.

What is expected?

The type should infer an array of the element if the ref is on a v-for to align with the vuejs behaviour https://vuejs.org/guide/essentials/template-refs.html#refs-inside-v-for

What is actually happening?

The type being inferred is only for one element of the referred element.

Link to minimal reproduction

No response

Any additional comments?

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working 🔨 p3-minor-bug
Projects
None yet
2 participants