mirror of
https://github.com/vuejs/vue.git
synced 2024-11-21 12:18:54 +00:00
types: fix manual api types for useAttrs/useListeners
This commit is contained in:
parent
adf3ac8adc
commit
ce6fc149e3
@ -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
|
||||
|
2
types/v3-manual-apis.d.ts
vendored
2
types/v3-manual-apis.d.ts
vendored
@ -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']
|
||||
|
Loading…
Reference in New Issue
Block a user