From b7e856a6d9dfba745cbc887e119c5fd27c927577 Mon Sep 17 00:00:00 2001 From: John Chiu Date: Mon, 9 Dec 2024 19:21:48 +0800 Subject: [PATCH] docs: add explanation for template-refs defineExpose before await (#3097) * docs: template-refs defineExpose before await * Update src/guide/essentials/template-refs.md --------- Co-authored-by: Natalia Tepluhina --- 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 499963255c..b902f213e2 100644 --- a/src/guide/essentials/template-refs.md +++ b/src/guide/essentials/template-refs.md @@ -237,6 +237,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. + See also: [Typing Component Template Refs](/guide/typescript/composition-api#typing-component-template-refs)