Nuxt/docs/content/1.docs/3.api/4.advanced/1.hooks.md
Sébastien Chopin 90784f79d7
docs: new website design (#9007)
* docs: implement new website theme

* chore: rename dirs

* chore: update build

* lint fix

* chore: update deps

* fix: include node_modules in esbuild step

* chore: update deps

* Update .gitignore

* chore: update theme version

* up

* up

* fix: use svg for illustration

* chore: update to 0.0.12

* chore: force parse5 resolution

* stay with build

* feat: always display first home section

* Update yarn.lock

* chore: update theme

* fix lint

* docs: update home title

* chore: update website theme version

* Update docs/content/0.index.md

Co-authored-by: pooya parsa <pyapar@gmail.com>

* Update docs/content/0.index.md

Co-authored-by: pooya parsa <pyapar@gmail.com>

* up

* chore: bump theme version

* up

* chore: up

* up up and up

* chore: generate

* fix: boolean value

* feat: new images

* update again

* chore: up

* ouep

* chore: up

Co-authored-by: Daniel Roe <daniel@roe.dev>
Co-authored-by: Clément Ollivier <clement.o2p@gmail.com>
Co-authored-by: pooya parsa <pyapar@gmail.com>
2022-11-16 11:04:28 +01:00

3.4 KiB

title description
Lifecycle Hooks Nuxt provides a powerful hooking system to expand almost every aspect using hooks.

Lifecycle Hooks

:ReadMore{link="/guide/going-further/hooks"}

App Hooks (runtime)

Check the app source code for all available hooks.

Hook Arguments Environment Description
app:created vueApp Server & Client Called when initial vueApp instance is created.
app:error err Server & Client Called when a fatal error occurs.
app:error:cleared { redirect? } Server & Client Called when a fatal error occurs.
app:data:refresh keys? Server & Client (internal)
vue:setup - Server & Client (internal)
vue:error err, target, info Server & Client Called when a vue error propages to the root component. Learn More.
app:rendered renderContext Server Called when SSR rendering is done.
app:redirected - Server Called before SSR redirection.
app:beforeMount vueApp Client Called before mounting the app, called only on client side.
app:mounted vueApp Client Called when Vue app is initialized and mounted in browser.
app:suspense:resolve appComponent Client On Suspense resolved event.
link:prefetch to Client Called when a <NuxtLink> is observed to be prefetched.
page:start pageComponent? Client Called on Suspense pending event.
page:finish pageComponent? Client Called on Suspense resolved event.
page:transition:finish pageComponent? Client After page transition onAfterLeave event.

Nuxt Hooks (build time)

Check the schema source code for all available hooks.

:NeedContribution

Nitro App Hooks (runtime, server-side)

Hook Arguments Description Types
render:response response, { event } Called before sending the response. response, event
render:html html, { event } Called before constructing the HTML. html, event