Skip to content

Commit 1e01200

Browse files
committed
docs: Update doc for extendPageData
1 parent a793312 commit 1e01200

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

packages/docs/docs/plugin/option-api.md

+11-1
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ import { SOURCE_DIR } from '@dynamic/constants'
280280

281281
## extendPageData
282282

283-
- Type: `Function`
283+
- Type: `Function|AsyncFunction`
284284
- Default: `undefined`
285285

286286
A function used to extend or modify the [$page](../guide/global-computed.md#page) object. This function will be invoking once for each page at compile time.
@@ -308,6 +308,16 @@ module.exports = {
308308
}
309309
```
310310

311+
Note that `extendPageData` can also be defined as an asynchronous function.
312+
313+
```js
314+
module.exports = {
315+
async extendPageData ($page) {
316+
$page.xxx = await getAsyncData()
317+
}
318+
}
319+
```
320+
311321
::: warning Note
312322
These fields starting with an `_` means you can only access them during build time.
313323
:::

0 commit comments

Comments
 (0)