From fffbb9e856de5e4b3053a6b4d01d1404bfb6f85e Mon Sep 17 00:00:00 2001 From: Nikhil Verma Date: Fri, 15 Jul 2022 14:35:04 +0530 Subject: [PATCH] fix(types): $refs can also contain ComponentPublicInstance (#12659) --- types/vue.d.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/types/vue.d.ts b/types/vue.d.ts index a86e2eebf3f..ed5b1817453 100644 --- a/types/vue.d.ts +++ b/types/vue.d.ts @@ -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 }