Skip to content

Home > @jview/hooks > usePickedProps

usePickedProps() function

从组件的 props 中挑选出部分属性,通常用于一些透传场景

Signature:

typescript
export declare function usePickedProps(props: PlainObject, keys: string[]): import("vue").ComputedRef<Pick<PlainObject, string>>;
export declare function usePickedProps(props: PlainObject, keys: string[]): import("vue").ComputedRef<Pick<PlainObject, string>>;

Parameters

ParameterTypeDescription
propsPlainObject组件属性
keysstring[]待挑选的组件属性的键组成的数组

Returns:

import("vue").ComputedRef<Pick<PlainObject, string>>