当每次点击按钮的时候,所有的votes都++了,怎么样才能单独的votes++呢?
1 回答

慕桂英4014372
TA贡献1871条经验 获得超13个赞
<button class="btn btn-default" @click="vote($index)">Vote</button>
vote: function (index) { this.candidates[index].votes++; }
添加回答
举报
0/150
提交
取消