diff --git a/packages/docs/docs/plugin/option-api.md b/packages/docs/docs/plugin/option-api.md index f216161025..9472283d47 100644 --- a/packages/docs/docs/plugin/option-api.md +++ b/packages/docs/docs/plugin/option-api.md @@ -280,7 +280,7 @@ import { SOURCE_DIR } from '@dynamic/constants' ## extendPageData -- Type: `Function` +- Type: `Function|AsyncFunction` - Default: `undefined` 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 = { } ``` +Note that `extendPageData` can also be defined as an asynchronous function. + +```js +module.exports = { + async extendPageData ($page) { + $page.xxx = await getAsyncData() + } +} +``` + ::: warning Note These fields starting with an `_` means you can only access them during build time. :::