Suppose I have nested elements that are repeated with v-for like this:
<div id="container">
<div v-for="i in 3">
<div v-for="j in 3" v-on:click="clicked(i,j)">
{{i+','+j}}
</div>
</div>
</div>
And the corresponding Javascript:
var vm = new Vue({
methods:{
clicked:function(i, j){
//How to access the click event here?
}
},
el:'#container'
})
If I use v-on:click="clicked" I can access the event (and the corresponding element) in the clicked function. But I want to supply the parameters i and j, how can I both access them and the click event? I want to be able to do this regardless of event (keyup, keydown, blur, focus etc).