The Elections People of Vue
{{ $data | json }}
{{ mayor | json }}
当每次点击按钮的时候,所有的votes都++了,怎么样才能单独的votes++呢?
<button class="btn btn-default" @click="vote($index)">Vote</button>
vote: function (index) { this.candidates[index].votes++; }