From 626a1c6e47a05a9c0338b40998ebb93763043fd0 Mon Sep 17 00:00:00 2001 From: ktsn Date: Mon, 26 Feb 2018 17:32:47 +0900 Subject: [PATCH 1/2] fix(types): fix wrong errorCaptured type --- types/options.d.ts | 2 +- types/test/options-test.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/types/options.d.ts b/types/options.d.ts index a54993fff5d..aeecbbfdaf7 100644 --- a/types/options.d.ts +++ b/types/options.d.ts @@ -80,7 +80,7 @@ export interface ComponentOptions< updated?(): void; activated?(): void; deactivated?(): void; - errorCaptured?(): boolean | void; + errorCaptured?(err: Error, vm: V, info: string): boolean | void; directives?: { [key: string]: DirectiveFunction | DirectiveOptions }; components?: { [key: string]: Component | AsyncComponent }; diff --git a/types/test/options-test.ts b/types/test/options-test.ts index a14560fe1b3..67971b6de46 100644 --- a/types/test/options-test.ts +++ b/types/test/options-test.ts @@ -199,7 +199,10 @@ Vue.component('component', { updated() {}, activated() {}, deactivated() {}, - errorCaptured() { + errorCaptured(err, vm, info) { + err.message + vm.$emit('error') + info.toUpperCase() return true }, From f7ab5c6536d3616d41c77391cff7d81f3728aad7 Mon Sep 17 00:00:00 2001 From: ktsn Date: Wed, 28 Feb 2018 14:54:00 +0900 Subject: [PATCH 2/2] fix(types): change vm type of errorCaptured to base type --- types/options.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/options.d.ts b/types/options.d.ts index aeecbbfdaf7..b817992b1b6 100644 --- a/types/options.d.ts +++ b/types/options.d.ts @@ -80,7 +80,7 @@ export interface ComponentOptions< updated?(): void; activated?(): void; deactivated?(): void; - errorCaptured?(err: Error, vm: V, info: string): boolean | void; + errorCaptured?(err: Error, vm: Vue, info: string): boolean | void; directives?: { [key: string]: DirectiveFunction | DirectiveOptions }; components?: { [key: string]: Component | AsyncComponent };