Skip to content

Commit

Permalink
fix(types): make render option in functional components to optional (v…
Browse files Browse the repository at this point in the history
  • Loading branch information
ktsn authored and hefeng committed Jan 25, 2019
1 parent a32b65b commit b3d6a68
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 b3d6a68

Please sign in to comment.