Skip to content

Commit 731e4d0

Browse files
shasharomanyyx990803
authored andcommitted
types: use normalized type for RenderContext.scopedSlots (#9624)
fix #9616
1 parent 0c4c78b commit 731e4d0

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

Diff for: types/options.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Vue, CreateElement, CombinedVueInstance } from "./vue";
2-
import { VNode, VNodeData, VNodeDirective, ScopedSlot } from "./vnode";
2+
import { VNode, VNodeData, VNodeDirective, NormalizedScopedSlot } from "./vnode";
33

44
type Constructor = {
55
new (...args: any[]): any;
@@ -140,7 +140,7 @@ export interface RenderContext<Props=DefaultProps> {
140140
data: VNodeData;
141141
parent: Vue;
142142
listeners: { [key: string]: Function | Function[] };
143-
scopedSlots: { [key: string]: ScopedSlot };
143+
scopedSlots: { [key: string]: NormalizedScopedSlot };
144144
injections: any
145145
}
146146

Diff for: types/test/vue-test.ts

+7
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,13 @@ const FunctionalHelloWorldComponent = Vue.extend({
147147
}
148148
});
149149

150+
const FunctionalScopedSlotsComponent = Vue.extend({
151+
functional: true,
152+
render(h, ctx) {
153+
return ctx.scopedSlots.default && ctx.scopedSlots.default({}) || h('div', 'functional scoped slots');
154+
}
155+
});
156+
150157
const Parent = Vue.extend({
151158
data() {
152159
return { greeting: 'Hello' }

Diff for: types/vue.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
ThisTypedComponentOptionsWithRecordProps,
1313
WatchOptions,
1414
} from "./options";
15-
import { VNode, VNodeData, VNodeChildren, ScopedSlot, NormalizedScopedSlot } from "./vnode";
15+
import { VNode, VNodeData, VNodeChildren, NormalizedScopedSlot } from "./vnode";
1616
import { PluginFunction, PluginObject } from "./plugin";
1717

1818
export interface CreateElement {

0 commit comments

Comments
 (0)