修复BUG

This commit is contained in:
kron
2025-09-18 09:28:14 +08:00
parent b952ea9fd0
commit 72ab9c3757
8 changed files with 96 additions and 34 deletions

View File

@@ -49,21 +49,11 @@ const props = defineProps({
const showsimul = ref(false);
const latestOne = ref(null);
const bluelatestOne = ref(null);
const prevScores = ref([]);
const prevBlueScores = ref([]);
// const startCount = ref(false);
const timer = ref(null);
// watch(
// () => props.start,
// (newVal) => {
// startCount.value = newVal;
// },
// {
// immediate: true,
// }
// );
watch(
() => props.scores,
(newVal) => {
@@ -85,10 +75,10 @@ watch(
() => props.blueScores,
(newVal) => {
if (newVal.length - prevBlueScores.value.length === 1) {
latestOne.value = newVal[newVal.length - 1];
bluelatestOne.value = newVal[newVal.length - 1];
if (timer.value) clearTimeout(timer.value);
timer.value = setTimeout(() => {
latestOne.value = null;
bluelatestOne.value = null;
}, 1000);
}
prevBlueScores.value = [...newVal];
@@ -176,7 +166,7 @@ onMounted(() => {
<view
v-if="bow.ring > 0"
:class="`hit ${
index === blueScores.length - 1 && latestOne ? 'pump-in' : ''
index === blueScores.length - 1 && bluelatestOne ? 'pump-in' : ''
}`"
:style="{
left: calcRealX(bow.x),