Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed RenderContext.scopedSlots types bug #9624

Merged
merged 2 commits into from
Mar 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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