@@ -280,7 +280,7 @@ import { SOURCE_DIR } from '@dynamic/constants'
...
@@ -280,7 +280,7 @@ import { SOURCE_DIR } from '@dynamic/constants'
## extendPageData
## extendPageData
- Type: `Function`
- Type: `Function|AsyncFunction`
- Default: `undefined`
- Default: `undefined`
A function used to extend or edit the [$page](../guide/global-computed.md#page) object. This function will be invoking once for each page at compile time.
A function used to extend or edit 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 = {
...
@@ -308,6 +308,16 @@ module.exports = {
}
}
```
```
Note that `extendPageData` can also be defined as an asynchronous function.
```js
module.exports={
asyncextendPageData($page){
$page.xxx=awaitgetAsyncData()
}
}
```
::: warning Note
::: warning Note
These fields starting with an `_` means you can only access them during build time.
These fields starting with an `_` means you can only access them during build time.