From 901a06711025c2866dcaa916670faaaa75ea877d Mon Sep 17 00:00:00 2001 From: Nikhil Verma <nikhilgotmail@gmail.com> Date: Thu, 14 Jul 2022 08:51:27 +0530 Subject: [PATCH 1/2] $refs can also contain CreateComponentPublicInstance --- types/vue.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/vue.d.ts b/types/vue.d.ts index b57c5016dd3..c07b4e9a6d5 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 { CreateComponentPublicInstance } from 'v3-component-public-instance' export interface CreateElement { ( @@ -56,7 +57,7 @@ export interface Vue< // Vue 2 only or shared readonly $el: Element readonly $refs: { - [key: string]: Vue | Element | (Vue | Element)[] | undefined + [key: string]: Vue | Element | (Vue | Element)[] | undefined | CreateComponentPublicInstance } readonly $slots: { [key: string]: VNode[] | undefined } readonly $scopedSlots: { [key: string]: NormalizedScopedSlot | undefined } From 0212c0ac81b119e14e525492724794168da340be Mon Sep 17 00:00:00 2001 From: Evan You <yyx990803@gmail.com> Date: Fri, 15 Jul 2022 05:01:35 -0400 Subject: [PATCH 2/2] Update vue.d.ts --- types/vue.d.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/types/vue.d.ts b/types/vue.d.ts index c07b4e9a6d5..e208d436e72 100644 --- a/types/vue.d.ts +++ b/types/vue.d.ts @@ -14,7 +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 { CreateComponentPublicInstance } from 'v3-component-public-instance' +import { ComponentPublicInstance } from 'v3-component-public-instance' export interface CreateElement { ( @@ -57,7 +57,12 @@ export interface Vue< // Vue 2 only or shared readonly $el: Element readonly $refs: { - [key: string]: Vue | Element | (Vue | Element)[] | undefined | CreateComponentPublicInstance + [key: string]: + | Vue + | Element + | ComponentPublicInstance + | (Vue | Element | ComponentPublicInstance)[] + | undefined } readonly $slots: { [key: string]: VNode[] | undefined } readonly $scopedSlots: { [key: string]: NormalizedScopedSlot | undefined }