Skip to content

Commit c57da05

Browse files
committed
fix: raf type error
1 parent 35bcec1 commit c57da05

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

components/_util/PortalWrapper.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import {
1414
} from 'vue';
1515
import canUseDom from './canUseDom';
1616
import ScrollLocker from '../vc-util/Dom/scrollLocker';
17+
import type { RafFrame } from './raf';
1718
import wrapperRaf from './raf';
1819

1920
let openCount = 0;
@@ -61,7 +62,7 @@ export default defineComponent({
6162
setup(props, { slots }) {
6263
const container = ref<HTMLElement>();
6364
const componentRef = ref();
64-
const rafId = ref<number>();
65+
const rafId = ref<RafFrame>();
6566
const scrollLocker = new ScrollLocker({
6667
container: getParent(props.getContainer) as HTMLElement,
6768
});

components/tabs/src/TabNavList/index.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import { onBeforeUnmount, defineComponent, ref, watch, watchEffect, computed } f
2222
import PropTypes from '../../../_util/vue-types';
2323
import useSyncState from '../hooks/useSyncState';
2424
import useState from '../../../_util/hooks/useState';
25+
import type { RafFrame } from '../../../_util/raf';
2526
import wrapperRaf from '../../../_util/raf';
2627
import classNames from '../../../_util/classNames';
2728
import ResizeObserver from '../../../vc-resize-observer';
@@ -337,7 +338,7 @@ export default defineComponent({
337338
const activeTabOffset = computed(() => tabOffsets.value.get(props.activeKey));
338339

339340
// Delay set ink style to avoid remove tab blink
340-
const inkBarRafRef = ref<number>();
341+
const inkBarRafRef = ref<RafFrame>();
341342
const cleanInkBarRaf = () => {
342343
wrapperRaf.cancel(inkBarRafRef.value);
343344
};

components/tabs/src/hooks/useRaf.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import type { Ref } from 'vue';
22
import { ref, onBeforeUnmount } from 'vue';
3+
import type { RafFrame } from '../../../_util/raf';
34
import wrapperRaf from '../../../_util/raf';
45

56
export default function useRaf<Callback extends Function>(callback: Callback) {
6-
const rafRef = ref<number>();
7+
const rafRef = ref<RafFrame>();
78
const removedRef = ref(false);
89

910
function trigger(...args: any[]) {

0 commit comments

Comments
 (0)