fix: use fromPairs replace Object.fromEntries (#5605)
* fix: use fromPairs replace Object.fromEntries * fix: use lodash-es replace lodashpull/5627/head
parent
bb85f1f372
commit
fdf76b9fb9
|
@ -1,5 +1,6 @@
|
|||
import type { UnwrapRef } from 'vue';
|
||||
import { reactive, toRef } from 'vue';
|
||||
import fromPairs from 'lodash-es/fromPairs';
|
||||
|
||||
/**
|
||||
* Reactively pick fields from a reactive object
|
||||
|
@ -10,5 +11,5 @@ export function reactivePick<T extends object, K extends keyof T>(
|
|||
obj: T,
|
||||
...keys: K[]
|
||||
): { [S in K]: UnwrapRef<T[S]> } {
|
||||
return reactive(Object.fromEntries(keys.map(k => [k, toRef(obj, k)]))) as any;
|
||||
return reactive(fromPairs(keys.map(k => [k, toRef(obj, k)]))) as any;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue