Skip to content

Commit

Permalink
fix(types): make render option in functional components to optional (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ktsn authored and yyx990803 committed Mar 8, 2018
1 parent ec9152f commit b2092db
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion types/options.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export interface FunctionalComponentOptions<Props = DefaultProps, PropDefs = Pro
props?: PropDefs;
inject?: InjectOptions;
functional: boolean;
render(this: undefined, createElement: CreateElement, context: RenderContext<Props>): VNode;
render?(this: undefined, createElement: CreateElement, context: RenderContext<Props>): VNode;
}

export interface RenderContext<Props=DefaultProps> {
Expand Down
4 changes: 4 additions & 0 deletions types/test/options-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,10 @@ Vue.component('functional-component-object-inject', {
}
})

Vue.component('functional-component-check-optional', {
functional: true
})

Vue.component("async-component", ((resolve, reject) => {
setTimeout(() => {
resolve(Vue.component("component"));
Expand Down

0 comments on commit b2092db

Please sign in to comment.