diff --git a/packages/runtime-core/src/apiWatch.ts b/packages/runtime-core/src/apiWatch.ts index ebbe33c21..927db3332 100644 --- a/packages/runtime-core/src/apiWatch.ts +++ b/packages/runtime-core/src/apiWatch.ts @@ -209,7 +209,7 @@ export function instanceWatch( source: string | Function, cb: Function, options?: WatchOptions -): () => void { +): StopHandle { const ctx = this.renderProxy! const getter = isString(source) ? () => ctx[source] : source.bind(ctx) const stop = watch(getter, cb.bind(ctx), options) diff --git a/packages/runtime-core/src/componentProxy.ts b/packages/runtime-core/src/componentProxy.ts index b175a8386..01324d2c0 100644 --- a/packages/runtime-core/src/componentProxy.ts +++ b/packages/runtime-core/src/componentProxy.ts @@ -3,7 +3,7 @@ import { nextTick } from './scheduler' import { instanceWatch } from './apiWatch' import { EMPTY_OBJ, hasOwn, globalsWhitelist } from '@vue/shared' import { ExtractComputedReturns } from './apiOptions' -import { UnwrapRef } from '@vue/reactivity' +import { UnwrapRef, ReactiveEffect } from '@vue/reactivity' import { warn } from './warning' // public properties exposed on the proxy, which is used as the render context @@ -25,6 +25,11 @@ export type ComponentPublicInstance< $root: ComponentInternalInstance | null $parent: ComponentInternalInstance | null $emit: (event: string, ...args: unknown[]) => void + $el: any + $options: any + $forceUpdate: ReactiveEffect + $nextTick: typeof nextTick + $watch: typeof instanceWatch } & P & UnwrapRef & D &