Skip to content

Commit 2ace266

Browse files
committed
feat: 替换 lodash 为 lodash-es
1 parent e3341bb commit 2ace266

File tree

13 files changed

+34
-18
lines changed

13 files changed

+34
-18
lines changed

packages/hooks/package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@
3333
"type": "tsc -d"
3434
},
3535
"dependencies": {
36-
"@vue/devtools-api": "^6.5.0",
3736
"@types/js-cookie": "^3.0.1",
37+
"@vue/devtools-api": "^6.5.0",
3838
"js-cookie": "^3.0.1",
39-
"lodash": "^4.17.21",
39+
"lodash-es": "^4.17.21",
4040
"qs": "^6.11.0",
4141
"query-string": "^7.1.1",
4242
"screenfull": "^5.0.0"
@@ -47,5 +47,8 @@
4747
"repository": "https://github.com/InhiblabCore/vue-hooks-plus",
4848
"homepage": "https://github.com/InhiblabCore/vue-hooks-plus",
4949
"author": "NelsonYong",
50-
"license": "MIT"
50+
"license": "MIT",
51+
"devDependencies": {
52+
"@types/lodash-es": "^4.17.12"
53+
}
5154
}

packages/hooks/src/useDebounceFn/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import debounce from 'lodash/debounce'
1+
import debounce from 'lodash-es/debounce'
22

33
export interface DebounceOptions {
44
/**

packages/hooks/src/useEventEmitter/event.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import cloneDeep from 'lodash/cloneDeep'
1+
import cloneDeep from 'lodash-es/cloneDeep'
22
import { ref, watchEffect } from 'vue'
33

44
type SubscriptionParams<T = any> = {

packages/hooks/src/useRequest/docs/debounce/index.en-US.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ desc="Quickly enter the text in the input box, trigger the run frequently, and w
2020

2121
## Options
2222

23-
The usage and effect of all debounce property are the same as [lodash.debounce](https://www.lodashjs.com/docs/lodash.debounce/)
23+
The usage and effect of all debounce property are the same as [lodash-es.debounce](https://www.lodash-esjs.com/docs/lodash-es.debounce/)
2424

2525
| Property | Description | Type | Default Value |
2626
| --- | --- | --- | --- |

packages/hooks/src/useRequest/docs/debounce/index.zh-CN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ source:
2020

2121
## Options
2222

23-
debounce 所有参数用法和效果同 [lodash.debounce](https://www.lodashjs.com/docs/lodash.debounce/)
23+
debounce 所有参数用法和效果同 [lodash-es.debounce](https://www.lodash-esjs.com/docs/lodash-es.debounce/)
2424

2525
| 参数 | 说明 | 类型 | 默认值 |
2626
| --- | --- | --- | --- |

packages/hooks/src/useRequest/docs/throttle/index.en-US.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ source:
1919

2020
## Options
2121

22-
The usage and effects of all throttle property are the same as [lodash.throttle](https://www.lodashjs.com/docs/lodash.throttle/)
22+
The usage and effects of all throttle property are the same as [lodash-es.throttle](https://www.lodash-esjs.com/docs/lodash-es.throttle/)
2323

2424
| Property | Description | Type | Default Value |
2525
| --- | --- | --- | --- |

packages/hooks/src/useRequest/docs/throttle/index.zh-CN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ source:
2020

2121
## Options
2222

23-
throttle 所有参数用法和效果同 [lodash.throttle](https://www.lodashjs.com/docs/lodash.throttle/)
23+
throttle 所有参数用法和效果同 [lodash-es.throttle](https://www.lodash-esjs.com/docs/lodash-es.throttle/)
2424

2525
| 参数 | 说明 | 类型 | 默认值 |
2626
| --- | --- | --- | --- |

packages/hooks/src/useRequest/plugins/useDebouncePlugin.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { ref, computed, watchEffect, unref } from "vue";
2-
import type { DebouncedFunc, DebounceSettings } from "lodash";
3-
import debounce from "lodash/debounce";
2+
import type { DebouncedFunc, DebounceSettings } from "lodash-es";
3+
import debounce from "lodash-es/debounce";
44
import type { UseRequestPlugin } from "../types";
55

66
const useDebouncePlugin: UseRequestPlugin<unknown, unknown[]> = (

packages/hooks/src/useRequest/plugins/useThrottlePlugin.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { computed, unref, watchEffect } from 'vue'
2-
import { type DebouncedFunc, type ThrottleSettings } from 'lodash'
3-
import throttle from 'lodash/throttle'
2+
import { type DebouncedFunc, type ThrottleSettings } from 'lodash-es'
3+
import { throttle } from 'lodash-es'
44
import { UseRequestPlugin } from '../types'
55

66
const useThrottlePlugin: UseRequestPlugin<unknown, unknown[]> = (

packages/hooks/src/useSetState/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { ref, Ref, unref, UnwrapRef, readonly, DeepReadonly, UnwrapNestedRefs } from 'vue'
2-
import merge from 'lodash/merge'
2+
import merge from 'lodash-es/merge'
33

44
type UseSetStateType<S> = S | (() => S) | Ref<S> | (() => Ref<S>)
55

0 commit comments

Comments
 (0)