-
-
Notifications
You must be signed in to change notification settings - Fork 33.8k
same ref name in multiple item do not create array in this.$refs when in render function #4035
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
Comments
This is working as expected, |
but my example abrove do not creates an array, because is in render function. it working as expected only in with v-for loop. so how can i achieve that in render function? |
add a refInFor attribute , https://jsfiddle.net/defcc/gmve9d3p/43/ render(createElement) {
return createElement('ul', [
createElement('li', { ref: 'a', refInFor: true }, 'a'),
createElement('li', { ref: 'a', refInFor: true }, 'a'),
createElement('li', { ref: 'a', refInFor: true }, 'a'),
createElement('li', { ref: 'a', refInFor: true }, 'a')
]);
} |
Thanks @defcc , it work well |
@defcc Is there a way to do that using the template syntax? |
Vue.js version
2.0.3
Reproduction Link
https://jsfiddle.net/WhiteCusp/gmve9d3p/35/
Steps to reproduce
What is Expected?
this.$refs.a should be a dom node list
What is actually happening?
this.$refs.a is a single dom
The text was updated successfully, but these errors were encountered: