Skip to content

Commit

Permalink
fix(components): 🐛 seamless-scroll, count-to
Browse files Browse the repository at this point in the history
- Type error  Argument of type 'Timer' is not assignable to parameter of type 'number'.
  • Loading branch information
jsxiaosi committed Nov 20, 2023
1 parent 754df3d commit 7c47f0b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions src/components/CountTo/src/rebound/index.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<script lang="tsx">
import type { Ref } from 'vue';
import {
defineComponent,
ref,
Expand All @@ -14,7 +13,7 @@
name: 'CountToRebound',
props: reboundProps,
setup(props) {
const timer = ref<NodeJS.Timer | null>(null);
const timer = ref<NodeJS.Timeout | string | number | undefined>();
onBeforeMount(() => {
const ua = navigator.userAgent.toLowerCase();
Expand All @@ -36,7 +35,7 @@
});
onBeforeUnmount(() => {
clearTimeout(unref(timer as Ref<NodeJS.Timer>));
clearTimeout(unref(timer));
});
return () => (
Expand Down
2 changes: 1 addition & 1 deletion src/components/SeamlessScroll/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
let realBoxHeight = ref<number>(0);
let copyHtml = ref('');
// single 单步滚动的定时器
let singleWaitTime: NodeJS.Timer | null = null;
let singleWaitTime: NodeJS.Timeout | string | number | undefined;
// move动画的animationFrame定时器
let reqFrame = 0;
let startPos: { x: number; y: number };
Expand Down

0 comments on commit 7c47f0b

Please sign in to comment.