From: Carter Li Date: Wed, 2 Sep 2020 01:08:01 +0000 (+0800) Subject: fix(types): fix `this` type of `this.$watch` (#2022) X-Git-Tag: v3.0.0-rc.10~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aa757e8e6d5f8f9ad60b1ec12c4ac9479be73c80;p=thirdparty%2Fvuejs%2Fcore.git fix(types): fix `this` type of `this.$watch` (#2022) --- diff --git a/packages/runtime-core/src/componentPublicInstance.ts b/packages/runtime-core/src/componentPublicInstance.ts index 35125ac819..c47941fc56 100644 --- a/packages/runtime-core/src/componentPublicInstance.ts +++ b/packages/runtime-core/src/componentPublicInstance.ts @@ -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 & D &