You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/docs/docs/plugin/option-api.md
+11-1
Original file line number
Diff line number
Diff line change
@@ -280,7 +280,7 @@ import { SOURCE_DIR } from '@dynamic/constants'
280
280
281
281
## extendPageData
282
282
283
-
- Type: `Function`
283
+
- Type: `Function|AsyncFunction`
284
284
- Default: `undefined`
285
285
286
286
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 = {
308
308
}
309
309
```
310
310
311
+
Note that `extendPageData` can also be defined as an asynchronous function.
312
+
313
+
```js
314
+
module.exports= {
315
+
asyncextendPageData ($page) {
316
+
$page.xxx=awaitgetAsyncData()
317
+
}
318
+
}
319
+
```
320
+
311
321
::: warning Note
312
322
These fields starting with an `_` means you can only access them during build time.
0 commit comments