From bf2e2ed159f680cd4e230427ce94739c657c1b61 Mon Sep 17 00:00:00 2001 From: Zev Goldstein Date: Wed, 24 Oct 2018 13:03:29 -0400 Subject: [PATCH] types: allow functional components to return multiple VNodes (#8192) close #8191 --- types/options.d.ts | 2 +- types/test/options-test.ts | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/types/options.d.ts b/types/options.d.ts index 8ae8f935..276a5b32 100644 --- a/types/options.d.ts +++ b/types/options.d.ts @@ -113,7 +113,7 @@ export interface FunctionalComponentOptions): VNode; + render?(this: undefined, createElement: CreateElement, context: RenderContext): VNode | VNode[]; } export interface RenderContext { diff --git a/types/test/options-test.ts b/types/test/options-test.ts index 83972d05..204b0dad 100644 --- a/types/test/options-test.ts +++ b/types/test/options-test.ts @@ -354,6 +354,16 @@ Vue.component('functional-component-check-optional', { functional: true }) +Vue.component('functional-component-multi-root', { + functional: true, + render(h) { + return [ + h("tr", [h("td", "foo"), h("td", "bar")]), + h("tr", [h("td", "lorem"), h("td", "ipsum")]) + ] + } +}) + Vue.component("async-component", ((resolve, reject) => { setTimeout(() => { resolve(Vue.component("component"));