fix bug
This commit is contained in:
@@ -60,8 +60,7 @@ const getTextStyle = (top, index) => {
|
|||||||
};
|
};
|
||||||
watch(
|
watch(
|
||||||
() => props.onComplete,
|
() => props.onComplete,
|
||||||
(newVal, oldVal) => {
|
(newVal) => {
|
||||||
if (newVal && !oldVal) {
|
|
||||||
if (timer.value) {
|
if (timer.value) {
|
||||||
clearInterval(timer.value);
|
clearInterval(timer.value);
|
||||||
timer.value = null;
|
timer.value = null;
|
||||||
@@ -76,15 +75,17 @@ watch(
|
|||||||
if (count === 10) {
|
if (count === 10) {
|
||||||
clearInterval(timer.value);
|
clearInterval(timer.value);
|
||||||
timer.value = null;
|
timer.value = null;
|
||||||
setTimeout(() => {
|
setTimeout(newVal, 1500);
|
||||||
newVal();
|
return;
|
||||||
}, 1500);
|
}
|
||||||
|
// 这里不重置,如果运行超13秒,就不会循环了
|
||||||
|
if (currentTop.value >= -4) {
|
||||||
|
currentTop.value = -totalHeight;
|
||||||
} else {
|
} else {
|
||||||
currentTop.value += 2;
|
currentTop.value += 2;
|
||||||
}
|
}
|
||||||
}, 40);
|
}, 40);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
);
|
);
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
timer.value = setInterval(() => {
|
timer.value = setInterval(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user