diff --git a/types/test/vue-test.ts b/types/test/vue-test.ts index 6fe0e56182c..72390b083b1 100644 --- a/types/test/vue-test.ts +++ b/types/test/vue-test.ts @@ -87,8 +87,10 @@ class Test extends Vue { this.nextTick(() => {}); this.nextTick().then(() => {}); this.set({}, "", ""); + this.set({}, 1, ""); this.set([true, false, true], 1, true); this.delete({}, ""); + this.delete({}, 1); this.delete([true, false], 0); this.directive("", {bind() {}}); this.filter("", (value: number) => value); diff --git a/types/vue.d.ts b/types/vue.d.ts index 29667ead1f6..44a892ead3b 100644 --- a/types/vue.d.ts +++ b/types/vue.d.ts @@ -91,9 +91,9 @@ export interface VueConstructor { nextTick(callback: () => void, context?: any[]): void; nextTick(): Promise - set(object: object, key: string, value: T): T; + set(object: object, key: string | number, value: T): T; set(array: T[], key: number, value: T): T; - delete(object: object, key: string): void; + delete(object: object, key: string | number): void; delete(array: T[], key: number): void; directive(