阅读(4854) (11)

Generator Class

2020-02-13 17:52:22 更新

Generator Class

Hooks

我们可以在某些生命周期事件中注册钩子。

HookArgumentsWhen
generate:before(nuxt, generateOptions)钩子(hook)生成之前
generate:distRemoved(nuxt)钩子(hook)目标文件夹已清理
generate:distCopied(nuxt)钩子(hook)复制静态和构建文件
generate:page({route, path, html})钩子(hook)让用户更新path&html
generate:routeCreated(route, path, errors)钩子(hook)生成页面成功
generate:extendRoutes(routes)钩子(hook)让用户更新要生成的路由
generate:routeFailed(route, errors)钩子(hook)保存生成的页面失败
generate:done(nuxt, errors)钩子(hook)生成完毕