Skip to content

Commit

Permalink
fix(types): fix wrong errorCaptured type (vuejs#7712)
Browse files Browse the repository at this point in the history
  • Loading branch information
ktsn authored and hefeng committed Jan 25, 2019
1 parent ba7bdd1 commit 55fdc41
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion types/options.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export interface ComponentOptions<
updated?(): void;
activated?(): void;
deactivated?(): void;
errorCaptured?(): boolean | void;
errorCaptured?(err: Error, vm: Vue, info: string): boolean | void;

directives?: { [key: string]: DirectiveFunction | DirectiveOptions };
components?: { [key: string]: Component<any, any, any, any> | AsyncComponent<any, any, any, any> };
Expand Down
5 changes: 4 additions & 1 deletion types/test/options-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,10 @@ Vue.component('component', {
updated() {},
activated() {},
deactivated() {},
errorCaptured() {
errorCaptured(err, vm, info) {
err.message
vm.$emit('error')
info.toUpperCase()
return true
},

Expand Down

0 comments on commit 55fdc41

Please sign in to comment.