fix(types): update this for nextTick api (#9541)

This commit is contained in:
Gcaufy 2019-03-01 05:54:07 +08:00 committed by Evan You
parent 2277b2322c
commit f33301619d
2 changed files with 4 additions and 1 deletions

View File

@ -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, "");

2
types/vue.d.ts vendored
View File

@ -89,7 +89,7 @@ export interface VueConstructor<V extends Vue = Vue> {
extend<Props>(definition: FunctionalComponentOptions<Props, RecordPropsDefinition<Props>>): ExtendedVue<V, {}, {}, {}, Props>;
extend(options?: ComponentOptions<V>): ExtendedVue<V, {}, {}, {}, {}>;
nextTick(callback: () => void, context?: any[]): void;
nextTick<T>(callback: (this: T) => void, context?: T): void;
nextTick(): Promise<void>
set<T>(object: object, key: string | number, value: T): T;
set<T>(array: T[], key: number, value: T): T;