diff --git a/src/App.vue b/src/App.vue index 29c3ced..d2a454a 100644 --- a/src/App.vue +++ b/src/App.vue @@ -230,8 +230,6 @@ export default { current: 0, max: 0, maxLose: 0, - player: 0, - computer: 0, }, }, winningPositions: null, // 保存获胜时的高亮状态 @@ -1238,14 +1236,15 @@ export default { } else { stats.playerWins++ stats.winningStreaks.current = Math.max(0, stats.winningStreaks.current) + 1 + stats.winningStreaks.max = Math.max( + stats.winningStreaks.max, + stats.winningStreaks.current, + ) } } else if (winner === (this.isPlayerBlack ? 1 : 2)) { stats.playerWins++ stats.winningStreaks.current = Math.max(0, stats.winningStreaks.current) + 1 - stats.winningStreaks.player = Math.max( - stats.winningStreaks.player, - stats.winningStreaks.current, - ) + stats.winningStreaks.max = Math.max(stats.winningStreaks.max, stats.winningStreaks.current) } else { stats.computerWins++ stats.winningStreaks.current = Math.min(0, stats.winningStreaks.current) - 1 @@ -1255,11 +1254,6 @@ export default { ) } - stats.winningStreaks.max = Math.max( - stats.winningStreaks.player, - stats.winningStreaks.computer, - ) - // 保存到本地存储 this.saveStatistics() }, @@ -1306,6 +1300,7 @@ export default {