fix: raf type error
parent
35bcec1e80
commit
c57da055fc
|
@ -14,6 +14,7 @@ import {
|
|||
} from 'vue';
|
||||
import canUseDom from './canUseDom';
|
||||
import ScrollLocker from '../vc-util/Dom/scrollLocker';
|
||||
import type { RafFrame } from './raf';
|
||||
import wrapperRaf from './raf';
|
||||
|
||||
let openCount = 0;
|
||||
|
@ -61,7 +62,7 @@ export default defineComponent({
|
|||
setup(props, { slots }) {
|
||||
const container = ref<HTMLElement>();
|
||||
const componentRef = ref();
|
||||
const rafId = ref<number>();
|
||||
const rafId = ref<RafFrame>();
|
||||
const scrollLocker = new ScrollLocker({
|
||||
container: getParent(props.getContainer) as HTMLElement,
|
||||
});
|
||||
|
|
|
@ -22,6 +22,7 @@ import { onBeforeUnmount, defineComponent, ref, watch, watchEffect, computed } f
|
|||
import PropTypes from '../../../_util/vue-types';
|
||||
import useSyncState from '../hooks/useSyncState';
|
||||
import useState from '../../../_util/hooks/useState';
|
||||
import type { RafFrame } from '../../../_util/raf';
|
||||
import wrapperRaf from '../../../_util/raf';
|
||||
import classNames from '../../../_util/classNames';
|
||||
import ResizeObserver from '../../../vc-resize-observer';
|
||||
|
@ -337,7 +338,7 @@ export default defineComponent({
|
|||
const activeTabOffset = computed(() => tabOffsets.value.get(props.activeKey));
|
||||
|
||||
// Delay set ink style to avoid remove tab blink
|
||||
const inkBarRafRef = ref<number>();
|
||||
const inkBarRafRef = ref<RafFrame>();
|
||||
const cleanInkBarRaf = () => {
|
||||
wrapperRaf.cancel(inkBarRafRef.value);
|
||||
};
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
import type { Ref } from 'vue';
|
||||
import { ref, onBeforeUnmount } from 'vue';
|
||||
import type { RafFrame } from '../../../_util/raf';
|
||||
import wrapperRaf from '../../../_util/raf';
|
||||
|
||||
export default function useRaf<Callback extends Function>(callback: Callback) {
|
||||
const rafRef = ref<number>();
|
||||
const rafRef = ref<RafFrame>();
|
||||
const removedRef = ref(false);
|
||||
|
||||
function trigger(...args: any[]) {
|
||||
|
|
Loading…
Reference in New Issue