types: add missing properties to ComponentPublicInstance interface (#218)
This commit is contained in:
parent
4a100828de
commit
f3760f7d34
@ -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)
|
||||
|
@ -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 &
|
||||
|
Loading…
Reference in New Issue
Block a user