types: fix createComponent type when using simple function (#334)
This commit is contained in:
parent
b5194b16bf
commit
068902abec
@ -13,9 +13,11 @@ import { isFunction } from '@vue/shared'
|
|||||||
|
|
||||||
// overload 1: direct setup function
|
// overload 1: direct setup function
|
||||||
// (uses user defined props interface)
|
// (uses user defined props interface)
|
||||||
export function createComponent<Props>(
|
export function createComponent<Props, RawBindings = object>(
|
||||||
setup: (props: Props, ctx: SetupContext) => object | (() => VNodeChild)
|
setup: (props: Props, ctx: SetupContext) => RawBindings | (() => VNodeChild)
|
||||||
): (props: Props) => any
|
): {
|
||||||
|
new (): ComponentPublicInstance<Props, RawBindings>
|
||||||
|
}
|
||||||
|
|
||||||
// overload 2: object format with no props
|
// overload 2: object format with no props
|
||||||
// (uses user defined props interface)
|
// (uses user defined props interface)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user