From 55fdc4102a18de7d343eeaa16980e472a0644a47 Mon Sep 17 00:00:00 2001 From: katashin Date: Fri, 9 Mar 2018 02:05:03 +0900 Subject: [PATCH] fix(types): fix wrong errorCaptured type (#7712) --- 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 dcaf5f5a0f3..6b5ebe41726 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: Vue, 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 df03ed787fc..6fc9e356451 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 },