Skip to content

Commit 65bef19

Browse files
committed
docs: add useClientData reference
1 parent da95c83 commit 65bef19

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed

docs/reference/client-api.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,33 @@ Client API can be imported from `vuepress/client`.
44

55
## Composition API
66

7+
### useClientData
8+
9+
- Details:
10+
11+
Returns all the client data ref objects.
12+
13+
Each property can also be accessed by the following composition APIs.
14+
15+
- Example:
16+
17+
```vue
18+
<script setup lang="ts">
19+
import { useClientData } from 'vuepress/client'
20+
21+
const {
22+
pageData,
23+
pageFrontmatter,
24+
pageHead,
25+
pageHeadTitle,
26+
pageLang,
27+
routeLocale,
28+
siteData,
29+
siteLocaleData,
30+
} = useClientData()
31+
</script>
32+
```
33+
734
### usePageData
835

936
- Details:

docs/zh/reference/client-api.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,33 @@
44

55
## 组合式 API
66

7+
### useClientData
8+
9+
- 详情:
10+
11+
返回所有客户端数据的 Ref 对象。
12+
13+
每个属性也可以通过下列的组合式 API 来访问。
14+
15+
- 示例:
16+
17+
```vue
18+
<script setup lang="ts">
19+
import { useClientData } from 'vuepress/client'
20+
21+
const {
22+
pageData,
23+
pageFrontmatter,
24+
pageHead,
25+
pageHeadTitle,
26+
pageLang,
27+
routeLocale,
28+
siteData,
29+
siteLocaleData,
30+
} = useClientData()
31+
</script>
32+
```
33+
734
### usePageData
835

936
- 详情:

0 commit comments

Comments
 (0)