The Nuxt Class
- Source: core/nuxt.js
This is the core container which allows all modules and classes communicate with each other. All modules have access to Nuxt instance using this.nuxt.
Hooks
We can register hooks on certain life cycle events.
nuxt.hook('ready', async nuxt => {
// Your custom code here
})
| Plugin | Arguments | When |
|---|---|---|
ready | (nuxt) | Nuxt is ready to work (ModuleContainer and Renderer ready). |
error | (error) | An unhandled error when calling hooks. |
close | (nuxt) | Nuxt instance is gracefully closing. |
listen | (server, {host, port}) | Nuxt internal server starts listening. (Using nuxt start or nuxt dev). |
Contributors
Sébastien Chopin
Debbie O'Brien
Benjamin Canac
fgiraud
Sergey Bedritsky
Alba Silvente Fuentes
Alexander Lichter
Krutie Patel
Daniel Roe
pooya parsa
Pim
Ahad Birang
Caught a mistake or want to contribute to the documentation? Edit this page on GitHub!
