From c389419da23d5eb64121c0ca637da37649c4a8b3 Mon Sep 17 00:00:00 2001 From: Gcaufy Date: Fri, 1 Mar 2019 05:54:07 +0800 Subject: [PATCH] fix(types): update this for nextTick api (#9541) --- types/test/vue-test.ts | 3 +++ types/vue.d.ts | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/types/test/vue-test.ts b/types/test/vue-test.ts index 57cafc478fa..54c4405264d 100644 --- a/types/test/vue-test.ts +++ b/types/test/vue-test.ts @@ -86,6 +86,9 @@ class Test extends Vue { } }); this.nextTick(() => {}); + this.nextTick(function () { + console.log(this.text === 'test'); + }, { text: 'test'}); this.nextTick().then(() => {}); this.set({}, "", ""); this.set({}, 1, ""); diff --git a/types/vue.d.ts b/types/vue.d.ts index 55e44657430..7391bbbd321 100644 --- a/types/vue.d.ts +++ b/types/vue.d.ts @@ -89,7 +89,7 @@ export interface VueConstructor { extend(definition: FunctionalComponentOptions>): ExtendedVue; extend(options?: ComponentOptions): ExtendedVue; - nextTick(callback: () => void, context?: any[]): void; + nextTick(callback: (this: T) => void, context?: T): void; nextTick(): Promise set(object: object, key: string | number, value: T): T; set(array: T[], key: number, value: T): T;