mirror of
https://github.com/vuejs/vue.git
synced 2024-11-22 04:39:46 +00:00
typings: type-checking WatchHandler -- refining
This commit is contained in:
parent
c662fe09c7
commit
ebe27295df
@ -1,6 +1,8 @@
|
||||
import Vue = require("../index");
|
||||
|
||||
class Test extends Vue {
|
||||
a: number;
|
||||
|
||||
testProperties() {
|
||||
this.$data;
|
||||
this.$el;
|
||||
@ -37,7 +39,7 @@ class Test extends Vue {
|
||||
immediate: true,
|
||||
deep: false
|
||||
})();
|
||||
this.$watch(() => {}, (val: number) => {});
|
||||
this.$watch(() => this.a, (val: number) => {});
|
||||
this.$on("", () => {});
|
||||
this.$once("", () => {});
|
||||
this.$off("", () => {});
|
||||
|
2
types/vue.d.ts
vendored
2
types/vue.d.ts
vendored
@ -55,7 +55,7 @@ export declare class Vue {
|
||||
options?: WatchOptions
|
||||
): (() => void);
|
||||
$watch<T>(
|
||||
expOrFn: () => T,
|
||||
expOrFn: (this: this) => T,
|
||||
callback: WatchHandler<this, T>,
|
||||
options?: WatchOptions
|
||||
): (() => void);
|
||||
|
Loading…
Reference in New Issue
Block a user