How can I pass the index of a v-for
loop as an argument to a click handler without it returning undefined?
<div v-for="(item, key, index) in groups" v-on:click="selected(index)">{{item.name}}</div>
Here's my Handler:
selected(i) {
console.log("you clicked " + i) // but this logs "you clicked undefined"
}