Skip to content

Commit b2092db

Browse files
ktsnyyx990803
authored andcommittedMar 8, 2018
fix(types): make render option in functional components to optional (#7663)
1 parent ec9152f commit b2092db

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed
 

‎types/options.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ export interface FunctionalComponentOptions<Props = DefaultProps, PropDefs = Pro
110110
props?: PropDefs;
111111
inject?: InjectOptions;
112112
functional: boolean;
113-
render(this: undefined, createElement: CreateElement, context: RenderContext<Props>): VNode;
113+
render?(this: undefined, createElement: CreateElement, context: RenderContext<Props>): VNode;
114114
}
115115

116116
export interface RenderContext<Props=DefaultProps> {

‎types/test/options-test.ts

+4
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,10 @@ Vue.component('functional-component-object-inject', {
331331
}
332332
})
333333

334+
Vue.component('functional-component-check-optional', {
335+
functional: true
336+
})
337+
334338
Vue.component("async-component", ((resolve, reject) => {
335339
setTimeout(() => {
336340
resolve(Vue.component("component"));

0 commit comments

Comments
 (0)
Please sign in to comment.