]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix(types): fix `this` type of `this.$watch` (#2022)
authorCarter Li <CarterLi@users.noreply.github.com>
Wed, 2 Sep 2020 01:08:01 +0000 (09:08 +0800)
committerGitHub <noreply@github.com>
Wed, 2 Sep 2020 01:08:01 +0000 (21:08 -0400)
packages/runtime-core/src/componentPublicInstance.ts

index 35125ac819a95f4ee6fb4b23cbe399656a1d23b4..c47941fc568973fb346d2cc88b6a28f7d32aac59 100644 (file)
@@ -1,6 +1,6 @@
 import { ComponentInternalInstance, Data } from './component'
 import { nextTick, queueJob } from './scheduler'
-import { instanceWatch } from './apiWatch'
+import { instanceWatch, WatchOptions, WatchStopHandle } from './apiWatch'
 import {
   EMPTY_OBJ,
   hasOwn,
@@ -162,7 +162,11 @@ export type ComponentPublicInstance<
   $options: Options
   $forceUpdate: ReactiveEffect
   $nextTick: typeof nextTick
-  $watch: typeof instanceWatch
+  $watch(
+    source: string | Function,
+    cb: Function,
+    options?: WatchOptions
+  ): WatchStopHandle
 } & P &
   ShallowUnwrapRef<B> &
   D &