ref inside v-for on template does not populate as an aray
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 54.4k
- Forks
- 9.2k
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 140
Description
Vue version
3.3.4
Link to minimal reproduction
Steps to reproduce
- Open reproduction link
- Open DevTools
- Observe console output
What is expected?
"Case 3" in output would see the ref value being an array - in Vue 2 it behaved this way
What is actually happening?
"Case 3" in output sees the ref value being a single element
System Info
No response
Any additional comments?
The bug manifests itself when we have a component that takes an arbitrary number of slots, and the consuming component populates those slots in a loop but needs an array of refs to the slot contents. The most basic case of this is implemented in the reproduction link.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the minimal reproduction linked in the issue and verify how a ref inside v-for on a template is populated in Vue 3.3.4 versus Vue 2. No source file or test is named, so trace the template-ref handling from the reproduction. Done means the Case 3 ref contains an array of slot elements and the behavior has regression coverage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100