fix(types): $refs can also contain ComponentPublicInstance (#12659)

This commit is contained in:
Nikhil Verma 2022-07-15 14:35:04 +05:30 committed by GitHub
parent e0a9546ef3
commit fffbb9e856
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

8
types/vue.d.ts vendored
View File

@ -14,6 +14,7 @@ import { VNode, VNodeData, VNodeChildren, NormalizedScopedSlot } from './vnode'
import { PluginFunction, PluginObject } from './plugin'
import { DefineComponent } from './v3-define-component'
import { nextTick } from './v3-generated'
import { ComponentPublicInstance } from 'v3-component-public-instance'
export interface CreateElement {
(
@ -58,7 +59,12 @@ export interface Vue<
// Vue 2 only or shared
readonly $el: Element
readonly $refs: {
[key: string]: Vue | Element | (Vue | Element)[] | undefined
[key: string]:
| Vue
| Element
| ComponentPublicInstance
| (Vue | Element | ComponentPublicInstance)[]
| undefined
}
readonly $slots: { [key: string]: VNode[] | undefined }
readonly $scopedSlots: { [key: string]: NormalizedScopedSlot | undefined }