Skip to content

Commit fdf76b9

Browse files
authored
fix: use fromPairs replace Object.fromEntries (#5605)
* fix: use fromPairs replace Object.fromEntries * fix: use lodash-es replace lodash
1 parent bb85f1f commit fdf76b9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

components/_util/reactivePick.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type { UnwrapRef } from 'vue';
22
import { reactive, toRef } from 'vue';
3+
import fromPairs from 'lodash-es/fromPairs';
34

45
/**
56
* Reactively pick fields from a reactive object
@@ -10,5 +11,5 @@ export function reactivePick<T extends object, K extends keyof T>(
1011
obj: T,
1112
...keys: K[]
1213
): { [S in K]: UnwrapRef<T[S]> } {
13-
return reactive(Object.fromEntries(keys.map(k => [k, toRef(obj, k)]))) as any;
14+
return reactive(fromPairs(keys.map(k => [k, toRef(obj, k)]))) as any;
1415
}

0 commit comments

Comments
 (0)