Skip to content

Commit

Permalink
fix(types): accept number type as key on Vue.set/delete (#8707) (#8709
Browse files Browse the repository at this point in the history
)
  • Loading branch information
nel215 authored and yyx990803 committed Dec 1, 2018
1 parent ac217d2 commit 0ba79e2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions types/test/vue-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions types/vue.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ export interface VueConstructor<V extends Vue = Vue> {

nextTick(callback: () => void, context?: any[]): void;
nextTick(): Promise<void>
set<T>(object: object, key: string, value: T): T;
set<T>(object: object, key: string | number, value: T): T;
set<T>(array: T[], key: number, value: T): T;
delete(object: object, key: string): void;
delete(object: object, key: string | number): void;
delete<T>(array: T[], key: number): void;

directive(
Expand Down

0 comments on commit 0ba79e2

Please sign in to comment.