Vue app uses v-for for rendering the array or list normally.
This is an example.
JsFiddle Example
new Vue({
el:'#mainapp',
data:{
items:[0,0, 0]
},
methods:{
updateVaule:function(index){
this.items[index]++;
alert('current value'+this.items[index]);
}
}
})
//Html file
<div id="mainapp">
<span v-for="(item,index) in items" v-on:click="updateVaule(index)">{{item}}</span>
</div>
But when the user clicking the span tag, the view is not updated though value of items had been changed.
I've tried to add v-bind:key=index to the span tag, but this didn't affect anything.
To render the updated array, how does the app have to work?
What am I wrong?