當每次點擊按鈕的時候,所有的votes都++了,怎么樣才能單獨的votes++呢?
關于對象遍歷的問題
飲歌長嘯
2018-08-27 09:12:42
TA貢獻1871條經驗 獲得超13個贊
<button class="btn btn-default" @click="vote($index)">Vote</button>
vote: function (index) { this.candidates[index].votes++; }
舉報