From 669fc650b588f1fa77f098340ad6b1458a0317e6 Mon Sep 17 00:00:00 2001 From: NelsonYong <1013588891@qq.com> Date: Tue, 13 Aug 2024 23:56:31 +0800 Subject: [PATCH] type: opt lodash --- packages/hooks/src/useKeyPress/index.ts | 1 - packages/hooks/src/useRequest/plugins/useDebouncePlugin.ts | 2 +- packages/hooks/src/useRequest/plugins/useThrottlePlugin.ts | 2 +- packages/use-request/src/plugins/useThrottlePlugin.ts | 2 +- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/hooks/src/useKeyPress/index.ts b/packages/hooks/src/useKeyPress/index.ts index abe4af3..4d836f3 100644 --- a/packages/hooks/src/useKeyPress/index.ts +++ b/packages/hooks/src/useKeyPress/index.ts @@ -1,5 +1,4 @@ import { ref } from 'vue' -// import { isFunction, isNumber, isString } from 'lodash' import { BasicTarget, getTargetElement } from '../utils/domTarget' import useDeepCompareEffectWithTarget from '../utils/useDeepCompareWithTarget' import { isNumber, isFunction, isString } from '../utils' diff --git a/packages/hooks/src/useRequest/plugins/useDebouncePlugin.ts b/packages/hooks/src/useRequest/plugins/useDebouncePlugin.ts index 7d3aae7..47bc2db 100644 --- a/packages/hooks/src/useRequest/plugins/useDebouncePlugin.ts +++ b/packages/hooks/src/useRequest/plugins/useDebouncePlugin.ts @@ -7,7 +7,7 @@ const useDebouncePlugin: UseRequestPlugin = ( fetchInstance, { debounceWait, debounceLeading, debounceTrailing, debounceMaxWait } ) => { - const debouncedRef = ref>(); + const debouncedRef = ref void) => void>>(); const options = computed(() => { const ret: DebounceSettings = {}; const debounceLeading_ = unref(debounceLeading) diff --git a/packages/hooks/src/useRequest/plugins/useThrottlePlugin.ts b/packages/hooks/src/useRequest/plugins/useThrottlePlugin.ts index 2ced2af..6c6a1a0 100644 --- a/packages/hooks/src/useRequest/plugins/useThrottlePlugin.ts +++ b/packages/hooks/src/useRequest/plugins/useThrottlePlugin.ts @@ -1,5 +1,5 @@ import { computed, unref, watchEffect } from 'vue' -import { DebouncedFunc, ThrottleSettings } from 'lodash' +import type { DebouncedFunc, ThrottleSettings } from 'lodash' import throttle from 'lodash/throttle' import { UseRequestPlugin } from '../types' diff --git a/packages/use-request/src/plugins/useThrottlePlugin.ts b/packages/use-request/src/plugins/useThrottlePlugin.ts index 2ced2af..6c6a1a0 100644 --- a/packages/use-request/src/plugins/useThrottlePlugin.ts +++ b/packages/use-request/src/plugins/useThrottlePlugin.ts @@ -1,5 +1,5 @@ import { computed, unref, watchEffect } from 'vue' -import { DebouncedFunc, ThrottleSettings } from 'lodash' +import type { DebouncedFunc, ThrottleSettings } from 'lodash' import throttle from 'lodash/throttle' import { UseRequestPlugin } from '../types'