vuejs / jsx-vue2

monorepo for Babel / Vue JSX related packages
https://jsx-vue2-playground.netlify.app/
1.47k stars 96 forks source link

我用 map return 一组 tag div, 每个 div 中再用 ref 标记一个组件,最后得到的是一个 object, 我希望的到的是数组 #299

Open wuyonggang100 opened 1 year ago

wuyonggang100 commented 1 year ago

{listx.map((info, index) => { return (

})} coonst refsX = this.$refs.xxxxRef ; console.log(refsX ) i hope refsX is a list , but it was an object ,why ?

wuyonggang100 commented 1 year ago

{listx.map((info, index) => { return (

})} coonst refsX = this.$refs.xxxxRef ; console.log(refsX ) i hope refsX is a list , but it was an object ,why ?

ding-js commented 1 year ago

https://v2.vuejs.org/v2/guide/render-function.html#The-Data-Object-In-Depth

子元素每个都加上 refInFor

Kane-Kuroneko commented 1 year ago

粘代码的时候麻烦用包一下 看不懂format