Nuxt Class

Nuxt Class

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

Hooks

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

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

作者:andy,如若转载,请注明出处:https://www.web176.com/nuxt/22347.html

(0)
打赏 支付宝 支付宝 微信 微信
andy的头像andy
上一篇 2023年5月24日
下一篇 2023年5月24日

相关推荐

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注