From c389bb7d955d046a3be0fdf9d3bcb70dfc91f2a8 Mon Sep 17 00:00:00 2001 From: icezhb <860435387@qq.com> Date: Sun, 29 Dec 2024 18:03:09 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=A7=E7=BB=AD=E8=90=BD=E5=AD=90=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=EF=BC=9B=E6=96=B0=E5=A2=9E=E6=88=98=E7=BB=A9=EF=BC=9B?= =?UTF-8?q?=E4=BC=98=E5=8C=96UI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 17 ++++++----------- src/assets/main.css | 6 +++--- 2 files changed, 9 insertions(+), 14 deletions(-) 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 {