Skip to content

Commit

Permalink
docs: add useClientData reference
Browse files Browse the repository at this point in the history
  • Loading branch information
meteorlxy committed Feb 6, 2024
1 parent da95c83 commit 65bef19
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
27 changes: 27 additions & 0 deletions docs/reference/client-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,33 @@ Client API can be imported from `vuepress/client`.

## Composition API

### useClientData

- Details:

Returns all the client data ref objects.

Each property can also be accessed by the following composition APIs.

- Example:

```vue
<script setup lang="ts">
import { useClientData } from 'vuepress/client'
const {
pageData,
pageFrontmatter,
pageHead,
pageHeadTitle,
pageLang,
routeLocale,
siteData,
siteLocaleData,
} = useClientData()
</script>
```

### usePageData

- Details:
Expand Down
27 changes: 27 additions & 0 deletions docs/zh/reference/client-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,33 @@

## 组合式 API

### useClientData

- 详情:

返回所有客户端数据的 Ref 对象。

每个属性也可以通过下列的组合式 API 来访问。

- 示例:

```vue
<script setup lang="ts">
import { useClientData } from 'vuepress/client'
const {
pageData,
pageFrontmatter,
pageHead,
pageHeadTitle,
pageLang,
routeLocale,
siteData,
siteLocaleData,
} = useClientData()
</script>
```

### usePageData

- 详情:
Expand Down

0 comments on commit 65bef19

Please sign in to comment.