Skip to content

Commit 6b8516b

Browse files
ktsnyyx990803
authored andcommitted
fix(types): fix wrong errorCaptured type (#7712)
1 parent 2b0fc38 commit 6b8516b

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

types/options.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export interface ComponentOptions<
8080
updated?(): void;
8181
activated?(): void;
8282
deactivated?(): void;
83-
errorCaptured?(): boolean | void;
83+
errorCaptured?(err: Error, vm: Vue, info: string): boolean | void;
8484

8585
directives?: { [key: string]: DirectiveFunction | DirectiveOptions };
8686
components?: { [key: string]: Component<any, any, any, any> | AsyncComponent<any, any, any, any> };

types/test/options-test.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,10 @@ Vue.component('component', {
199199
updated() {},
200200
activated() {},
201201
deactivated() {},
202-
errorCaptured() {
202+
errorCaptured(err, vm, info) {
203+
err.message
204+
vm.$emit('error')
205+
info.toUpperCase()
203206
return true
204207
},
205208

0 commit comments

Comments
 (0)