diff --git a/src/v3/apiSetup.ts b/src/v3/apiSetup.ts index ea8448072..064e15dc7 100644 --- a/src/v3/apiSetup.ts +++ b/src/v3/apiSetup.ts @@ -181,18 +181,25 @@ export function syncSetupSlots(to: any, from: any) { } /** - * @internal use manual type def because it relies on legacy VNode types + * @internal use manual type def because public setup context type relies on + * legacy VNode types */ export function useSlots(): SetupContext['slots'] { return getContext().slots } +/** + * @internal use manual type def because public setup context type relies on + * legacy VNode types + */ export function useAttrs(): SetupContext['attrs'] { return getContext().attrs } /** * Vue 2 only + * @internal use manual type def because public setup context type relies on + * legacy VNode types */ export function useListeners(): SetupContext['listeners'] { return getContext().listeners diff --git a/types/v3-manual-apis.d.ts b/types/v3-manual-apis.d.ts index 2f8e94b11..8636c11d6 100644 --- a/types/v3-manual-apis.d.ts +++ b/types/v3-manual-apis.d.ts @@ -6,3 +6,5 @@ export function getCurrentInstance(): { proxy: Vue } | null export const h: CreateElement export function useSlots(): SetupContext['slots'] +export function useAttrs(): SetupContext['attrs'] +export function useListeners(): SetupContext['listeners']