From: Dmitry Sharshakov Date: Mon, 21 Oct 2019 17:44:01 +0000 (+0300) Subject: types: use RenderFunction type (#342) X-Git-Tag: v3.0.0-alpha.0~355 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1f4937c2fdf62c0a1ccf53381179450772dd2f60;p=thirdparty%2Fvuejs%2Fcore.git types: use RenderFunction type (#342) --- diff --git a/packages/runtime-core/src/apiCreateComponent.ts b/packages/runtime-core/src/apiCreateComponent.ts index c4ef3eee59..1979d231f0 100644 --- a/packages/runtime-core/src/apiCreateComponent.ts +++ b/packages/runtime-core/src/apiCreateComponent.ts @@ -5,8 +5,7 @@ import { ComponentOptionsWithArrayProps, ComponentOptionsWithObjectProps } from './apiOptions' -import { SetupContext } from './component' -import { VNodeChild } from './vnode' +import { SetupContext, RenderFunction } from './component' import { ComponentPublicInstance } from './componentProxy' import { ExtractPropTypes } from './componentProps' import { isFunction } from '@vue/shared' @@ -14,7 +13,7 @@ import { isFunction } from '@vue/shared' // overload 1: direct setup function // (uses user defined props interface) export function createComponent( - setup: (props: Props, ctx: SetupContext) => RawBindings | (() => VNodeChild) + setup: (props: Props, ctx: SetupContext) => RawBindings | RenderFunction ): { new (): ComponentPublicInstance } diff --git a/packages/runtime-core/src/apiOptions.ts b/packages/runtime-core/src/apiOptions.ts index 59b69dc913..d3a87ade6d 100644 --- a/packages/runtime-core/src/apiOptions.ts +++ b/packages/runtime-core/src/apiOptions.ts @@ -2,7 +2,8 @@ import { ComponentInternalInstance, Data, Component, - SetupContext + SetupContext, + RenderFunction } from './component' import { isFunction, @@ -32,7 +33,6 @@ import { import { reactive } from '@vue/reactivity' import { ComponentObjectPropsOptions, ExtractPropTypes } from './componentProps' import { Directive } from './directives' -import { VNodeChild } from './vnode' import { ComponentPublicInstance } from './componentProxy' import { warn } from './warning' @@ -47,7 +47,7 @@ interface ComponentOptionsBase< this: null, props: Props, ctx: SetupContext - ) => RawBindings | (() => VNodeChild) | void + ) => RawBindings | RenderFunction | void name?: string template?: string // Note: we are intentionally using the signature-less `Function` type here