-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
the div which has the ref attribute inside the v-for, when I v-if toggle them, the ref value.length increase more and more #9239
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
Labels
Comments
a workaround: <div v-for="(vv0, index0) in 3" :key="index0" ref="refDivArr">
+<div v-for="(vv0, index0) in 3" ref="refDivArr">
<CompB ref="refCompArr"></CompB>
</div> |
If I use ref function, it can not get |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Vue version
3.2.47
Link to minimal reproduction
https://play.vuejs.org/#eNqtVUtv00AQ/iuDOSSV0qSot9QttNADSDxEERfMwbUnzjab3dU+3ESR/zuz68R2nNIglR6a3Z1v5pu3N9G1UuPSYTSNYpNppiwYtE4BT0VxmUTWJNFVIthSSW1hAxpnI/qXZpaVOAIpPksnLOYjyORSuXB6TG02hwpmWi5hQMYHjYH3BLrZCsaTcPPsBEhEJoWxwMxPZtg9R7j0ZEOrHZ4kYuYEUUoBVhYFxy1meAKbRECrNC5T7rzqq95TIqqWg+x+YOUdE2RpSyMc50TTyL1rTwH2TVxrvRX/+t3X7sniSZ1eSmZscal4apHOAHHOSjB2zZHSfS91jnoKb9QKjOQsh9eIeAEqzXPyhgRnahUqAvTnVa+6wUxhE0rURldV8cSj9hXa6HYanXh7KnMNk0M+im7MURR23uFsH5/hPdTcfz3G3zYIabeXtzBYoxnAFAZCDvpG7p211DzvMs6yhW/rbhdRPvfu8aSGk3LLC+Upm5Fmw5hETdXmyIq59cWh6lzAYRGV0yrw1PYATEj17hbsUyLIVLd4HTxh6tFpUG3BCBbXo9TA92Lv1eFlgTCx6LiVap2u96IoT2dSk6VhWZ6NgIkcV2cn9AvnRDNd4Nozh1e6d0OmBjgab435t2B3p3jSmbY4BAomkwrz3YrjaPySowH1QkJFI1p7NMszVowfjBS0G8OWSSK/4xhH/VX5XURa1MI1cRKlnMvHT+HN76zR7j2bY7Z44v3B0CBP6fBNo0FdUh0amU11gbYW3959wRWdG+FS5s5X7Rnhd6RyOe9jDbtxIie3O7jg7cewlKmJfpjblUVhdkF5Rz2yCvgkohXtc/630Ft3z8fnQY/WLWWx2e//7+vS+6wkosEM6WNweQWb6uiyzXhqDLE/6lT52UdjX9It1R+VZ24c
Steps to reproduce
if I click
toggleVisible
many times,refDivSingle
toggle between null and divrefCompSingle
toggle between null and {}refDivArr.length
increase more and more <-- error hererefCompArr.length
toggle between 3 and 0if I use ref function, it don't get null

What is expected?
the
refDivArr.length
should toggle between 3 and 0, same as therefCompArr.length
What is actually happening?
the
refDivArr.length
increase more and moreSystem Info
No response
Any additional comments?
No response
The text was updated successfully, but these errors were encountered: