]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
types: add missing properties to ComponentPublicInstance interface (#218)
authorCr <631807682@qq.com>
Sat, 12 Oct 2019 14:30:21 +0000 (22:30 +0800)
committerEvan You <yyx990803@gmail.com>
Sat, 12 Oct 2019 14:30:21 +0000 (10:30 -0400)
packages/runtime-core/src/apiWatch.ts
packages/runtime-core/src/componentProxy.ts

index ebbe33c215132f0156334977378de90ea2a48980..927db3332125c3e5017b9eb035c6a8fe9a2f7f25 100644 (file)
@@ -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)
index b175a8386d41e85f678bb49d4a05b92dbdba98c2..01324d2c0eeadf0306139a657b86f200a3eddbeb 100644 (file)
@@ -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<B> &
   D &