Skip to content

Commit

Permalink
types: use normalized type for RenderContext.scopedSlots (vuejs#9624)
Browse files Browse the repository at this point in the history
  • Loading branch information
shasharoman authored and Lostlover committed Dec 10, 2019
1 parent f7207d6 commit b5c2f7d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
4 changes: 2 additions & 2 deletions 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;
Expand Down Expand Up @@ -140,7 +140,7 @@ export interface RenderContext<Props=DefaultProps> {
data: VNodeData;
parent: Vue;
listeners: { [key: string]: Function | Function[] };
scopedSlots: { [key: string]: ScopedSlot };
scopedSlots: { [key: string]: NormalizedScopedSlot };
injections: any
}

Expand Down
7 changes: 7 additions & 0 deletions types/test/vue-test.ts
Expand Up @@ -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' }
Expand Down
2 changes: 1 addition & 1 deletion types/vue.d.ts
Expand Up @@ -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 {
Expand Down

0 comments on commit b5c2f7d

Please sign in to comment.