mirror of
https://gitee.com/ant-design-vue/ant-design-vue.git
synced 2024-11-30 11:08:00 +08:00
fix: use fromPairs replace Object.fromEntries (#5605)
* fix: use fromPairs replace Object.fromEntries * fix: use lodash-es replace lodash
This commit is contained in:
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
Block a user