From 71d961800d638ba32e8e4bd659d8968f0f0fb52c Mon Sep 17 00:00:00 2001 From: ULIVZ <472590061@qq.com> Date: Sun, 9 Dec 2018 23:15:33 +0800 Subject: [PATCH] docs($plugin): refactor --- packages/docs/docs/plugin/life-cycle.md | 14 ++++++++------ packages/docs/docs/zh/plugin/life-cycle.md | 12 +++++++----- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/packages/docs/docs/plugin/life-cycle.md b/packages/docs/docs/plugin/life-cycle.md index ed13eea8ec..0135203c61 100644 --- a/packages/docs/docs/plugin/life-cycle.md +++ b/packages/docs/docs/plugin/life-cycle.md @@ -13,11 +13,11 @@ module.exports = { } ``` -::: tip 提示 +::: tip The `ready` hook is executed after the application is initialized and before some specific functional APIs are executed. These functional APIs include: -- clientDynamicModules -- enhanceAppFiles +- [clientDynamicModules](./option-api.md#clientdynamicmodules) +- [enhanceAppFiles](./option-api.md#enhanceappfiles) ::: @@ -34,14 +34,16 @@ module.exports = { } ``` -## generated +### generated - Type: `AsyncFunction` - Scope:`build` -```js + Called when a (production) build finishes, with an array of generated page HTML paths. + +``` js module.exports = { - async generated() { + async generated (pagePaths) { // ... } } diff --git a/packages/docs/docs/zh/plugin/life-cycle.md b/packages/docs/docs/zh/plugin/life-cycle.md index 74401a0569..3b7368ce56 100644 --- a/packages/docs/docs/zh/plugin/life-cycle.md +++ b/packages/docs/docs/zh/plugin/life-cycle.md @@ -17,8 +17,8 @@ module.exports = { `ready` 钩子在应用初始化之后,并在某些特定的函数式 API 执行之前执行。这些函数式 API 包括: -- clientDynamicModules -- enhanceAppFiles +- [clientDynamicModules](./option-api.md#clientdynamicmodules) +- [enhanceAppFiles](./option-api.md#enhanceappfiles) ::: @@ -35,14 +35,16 @@ module.exports = { } ``` -## generated +### generated - 类型: `AsyncFunction` - 作用域:`build` -```js +在生产环境的构建结束后被调用,生成的页面的路径数组将作为该函数的第一个参数。 + +``` js module.exports = { - async generated() { + async generated (pagePaths) { // ... } }