From 808f2d877aa34611dc4b5206849990eee05a694a Mon Sep 17 00:00:00 2001 From: Zakhar Shymanchyk Date: Tue, 21 Jan 2025 19:01:27 +0700 Subject: [PATCH] docs: explain how to use `ClientOnly` with `onMounted` hook (#30670) --- docs/3.api/1.components/1.client-only.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/docs/3.api/1.components/1.client-only.md b/docs/3.api/1.components/1.client-only.md index 86e56d2547..1d3b50cf38 100644 --- a/docs/3.api/1.components/1.client-only.md +++ b/docs/3.api/1.components/1.client-only.md @@ -51,3 +51,26 @@ The content of the default slot will be tree-shaken out of the server build. (Th ``` + +## Examples + +### Accessing HTML Elements + +Components inside `` are rendered only after being mounted. To access the rendered elements in the DOM, you can watch a template ref: + +```vue [pages/example.vue] + + + +```