[Vuejs]-I need to refer to ref parameter with dynamic name from vue template

0👍

Firstly: How to debug this? (this will help you down the path).

You can do a simple console.log(this.$refs) to check out how the refs are structured in your component.

Now to the answer. Whenever you use refs inside v-for Vue will create an array. You can access what you are expecting to access by:

$refs[("imgInput" + i)][0].click()

Leave a comment