From 7de8b57692f7e45fee62f1ba06555f3ba71cf3ba Mon Sep 17 00:00:00 2001 From: John Chiu Date: Thu, 7 Nov 2024 06:40:37 +0000 Subject: [PATCH 1/2] docs: template-refs defineExpose before await --- src/guide/essentials/template-refs.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/guide/essentials/template-refs.md b/src/guide/essentials/template-refs.md index f57f82c005..eec126347f 100644 --- a/src/guide/essentials/template-refs.md +++ b/src/guide/essentials/template-refs.md @@ -314,6 +314,8 @@ defineExpose({ When a parent gets an instance of this component via template refs, the retrieved instance will be of the shape `{ a: number, b: number }` (refs are automatically unwrapped just like on normal instances). +Note that defineExpose must be called before any await operation. Otherwise, properties and methods exposed after the await operation will not be accessible. ([Related Discussion](https://github.com/vuejs/core/issues/4930)) + See also: [Typing Component Template Refs](/guide/typescript/composition-api#typing-component-template-refs) From 24b041f0bf0c4cc25d706ac04110076908ff8692 Mon Sep 17 00:00:00 2001 From: Natalia Tepluhina Date: Mon, 9 Dec 2024 12:19:20 +0100 Subject: [PATCH 2/2] Update src/guide/essentials/template-refs.md --- src/guide/essentials/template-refs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/guide/essentials/template-refs.md b/src/guide/essentials/template-refs.md index eec126347f..c5b72ffb9e 100644 --- a/src/guide/essentials/template-refs.md +++ b/src/guide/essentials/template-refs.md @@ -314,7 +314,7 @@ defineExpose({ When a parent gets an instance of this component via template refs, the retrieved instance will be of the shape `{ a: number, b: number }` (refs are automatically unwrapped just like on normal instances). -Note that defineExpose must be called before any await operation. Otherwise, properties and methods exposed after the await operation will not be accessible. ([Related Discussion](https://github.com/vuejs/core/issues/4930)) +Note that defineExpose must be called before any await operation. Otherwise, properties and methods exposed after the await operation will not be accessible. See also: [Typing Component Template Refs](/guide/typescript/composition-api#typing-component-template-refs)