From: Evan You Date: Sat, 26 Oct 2019 20:32:27 +0000 (-0400) Subject: chore: fix typing for withDirectives X-Git-Tag: v3.0.0-alpha.0~297 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=43f4bd3aaa80a3e308ed3c27717dbc83a10daff1;p=thirdparty%2Fvuejs%2Fcore.git chore: fix typing for withDirectives --- diff --git a/packages/runtime-core/src/directives.ts b/packages/runtime-core/src/directives.ts index 052138a83e..9f77358706 100644 --- a/packages/runtime-core/src/directives.ts +++ b/packages/runtime-core/src/directives.ts @@ -104,11 +104,14 @@ export type DirectiveArguments = Array< | [Directive, any, string, DirectiveModifiers] > -export function withDirectives(vnode: VNode, directives: DirectiveArguments) { +export function withDirectives( + vnode: T, + directives: DirectiveArguments +): T { const internalInstance = currentRenderingInstance if (internalInstance === null) { __DEV__ && warn(`withDirectives can only be used inside render functions.`) - return + return vnode } const instance = internalInstance.renderProxy const props = vnode.props || (vnode.props = {})