LancerComet / vue2-jsx-runtime

JSX runtime for Vue 2.
Apache License 2.0
23 stars 6 forks source link

refInFor does not work for ref array for multiple refs with the same ref name #13

Closed s-elo closed 1 year ago

s-elo commented 1 year ago
<div ref='r1' refInFor>Wow very doge1</div>
<div ref='r1' refInFor>Wow very doge2</div>
<div ref='r1' refInFor>Wow very doge3</div>

const multiRefs = refs.r1
// false, multiRefs is a HTMLDivElement object of the third ref1 whose text is "Wow very doge3"
expect(Array.isArray(multiRefs)).toBe(true)
expect(multiRefs.map(r => r.textContent))
  .toEqual(Array.from({ length: 3 }, (_, idx) => `Wow very doge${idx + 1}`))
LancerComet commented 1 year ago

A new version 0.5.0 has been published to npm, thank you for your work! 🥰 @s-elo