更换事件
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<script setup>
|
||||
import { ref, onMounted, onUnmounted, watch } from "vue";
|
||||
import { ref, onMounted, onBeforeUnmount, watch } from "vue";
|
||||
const props = defineProps({
|
||||
stopMatch: {
|
||||
type: Function,
|
||||
@@ -94,7 +94,7 @@ onMounted(() => {
|
||||
textStyles.value = getTextStyle(totalTop.value);
|
||||
}, 40);
|
||||
});
|
||||
onUnmounted(() => {
|
||||
onBeforeUnmount(() => {
|
||||
if (timer.value) clearInterval(timer.value);
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user