Browse Source

fix(types): accept `number` type as key on Vue.set/delete (#8707) (#8709)

dev
nel215 6 years ago
committed by Evan You
parent
commit
0ba79e2588
  1. 2
      types/test/vue-test.ts
  2. 4
      types/vue.d.ts

2
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);

4
types/vue.d.ts

@ -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(

Loading…
Cancel
Save