diff --git a/types/options.d.ts b/types/options.d.ts index 1bb5fbb619f..dcb38614ed3 100644 --- a/types/options.d.ts +++ b/types/options.d.ts @@ -1,5 +1,5 @@ import { Vue, CreateElement, CombinedVueInstance } from "./vue"; -import { VNode, VNodeData, VNodeDirective, ScopedSlot } from "./vnode"; +import { VNode, VNodeData, VNodeDirective, NormalizedScopedSlot } from "./vnode"; type Constructor = { new (...args: any[]): any; @@ -140,7 +140,7 @@ export interface RenderContext { data: VNodeData; parent: Vue; listeners: { [key: string]: Function | Function[] }; - scopedSlots: { [key: string]: ScopedSlot }; + scopedSlots: { [key: string]: NormalizedScopedSlot }; injections: any } diff --git a/types/test/vue-test.ts b/types/test/vue-test.ts index 54c4405264d..ca04e84714a 100644 --- a/types/test/vue-test.ts +++ b/types/test/vue-test.ts @@ -147,6 +147,13 @@ const FunctionalHelloWorldComponent = Vue.extend({ } }); +const FunctionalScopedSlotsComponent = Vue.extend({ + functional: true, + render(h, ctx) { + return ctx.scopedSlots.default && ctx.scopedSlots.default({}) || h('div', 'functional scoped slots'); + } +}); + const Parent = Vue.extend({ data() { return { greeting: 'Hello' } diff --git a/types/vue.d.ts b/types/vue.d.ts index be2477b3f27..204f9cca94d 100644 --- a/types/vue.d.ts +++ b/types/vue.d.ts @@ -12,7 +12,7 @@ import { ThisTypedComponentOptionsWithRecordProps, WatchOptions, } from "./options"; -import { VNode, VNodeData, VNodeChildren, ScopedSlot, NormalizedScopedSlot } from "./vnode"; +import { VNode, VNodeData, VNodeChildren, NormalizedScopedSlot } from "./vnode"; import { PluginFunction, PluginObject } from "./plugin"; export interface CreateElement {