Nuxt Class

  • 来源: core/nuxt.js这是核心容器,允许所有模块和类相互通信。所有模块都可以使用this.nuxt访问Nuxt实例。

Hooks

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

  1. nuxt.hook('ready', async nuxt => {
  2. // Your custom code here
  3. })
PluginArgumentsWhen
ready(nuxt)Nuxt实例初始化 (ModuleContainerRenderer 已经准备好).
error(error)调用hooks时出现未处理的错误。
close(nuxt)Nuxt实例优雅地关闭。
listen(server, {host, port})Nuxt内部服务器开始监听。 (使用 nuxt startnuxt dev).