修复BUG
This commit is contained in:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user