Consider
<ul>
<li v-for="o in objects" v-on:click="click"></li>
</ul>
where objects in something like
var objects = [
{ derp: 1 },
{ derp: 2 },
];
in my click() function, I want to get access to o instance.
function click(event) {
console.log(event.target.myObject);
}
<li v-for="o in objects" v-on:click="click" v-bind:data-myObject="o"></li>
and then getting the object using event.target.getAttribute("data-myObject") yields a string, not object.
I can make this work using an index, and then lookup the object from this.$data.objects[index]. This seems backward to me, as I expect some way of binding o instance to the target generated <li> element.
How to do this?