Skip to content

Commit 60c2e54

Browse files
GcaufyLostlover
authored andcommitted
fix(types): update this for nextTick api (vuejs#9541)
1 parent 0f076bf commit 60c2e54

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

types/test/vue-test.ts

+3
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ class Test extends Vue {
8686
}
8787
});
8888
this.nextTick(() => {});
89+
this.nextTick(function () {
90+
console.log(this.text === 'test');
91+
}, { text: 'test'});
8992
this.nextTick().then(() => {});
9093
this.set({}, "", "");
9194
this.set({}, 1, "");

types/vue.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export interface VueConstructor<V extends Vue = Vue> {
8989
extend<Props>(definition: FunctionalComponentOptions<Props, RecordPropsDefinition<Props>>): ExtendedVue<V, {}, {}, {}, Props>;
9090
extend(options?: ComponentOptions<V>): ExtendedVue<V, {}, {}, {}, {}>;
9191

92-
nextTick(callback: () => void, context?: any[]): void;
92+
nextTick<T>(callback: (this: T) => void, context?: T): void;
9393
nextTick(): Promise<void>
9494
set<T>(object: object, key: string | number, value: T): T;
9595
set<T>(array: T[], key: number, value: T): T;

0 commit comments

Comments
 (0)