[Vuejs]-When using vue.js 2.0, how do you pass an array index to a method inside of a v-on:click?

0👍

You should not use interpolation inside attribute values.

Please, try:

<button v-on:click="addName(index, 'susan')">Susan</button>

You can use the shorthand @ for v-on:

<button @click="addName(index, 'susan')">Susan</button>

Leave a comment