Skip to content

Commit dd5e8c8

Browse files
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 <[email protected]>
1 parent e63d3ea commit dd5e8c8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/guide/essentials/template-refs.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,8 @@ defineExpose({
314314

315315
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).
316316

317+
Note that defineExpose must be called before any await operation. Otherwise, properties and methods exposed after the await operation will not be accessible.
318+
317319
See also: [Typing Component Template Refs](/guide/typescript/composition-api#typing-component-template-refs) <sup class="vt-badge ts" />
318320

319321
</div>

0 commit comments

Comments
 (0)