Movatterモバイル変換


[0]ホーム

URL:


Wayback Machine
41 captures
16 Nov 2022 - 28 Aug 2025
AugSEPOct
29
202220232024
success
fail
COLLECTED BY
Collection:Common Crawl
Web crawl data from Common Crawl.
TIMESTAMPS
loading
The Wayback Machine - http://web.archive.org/web/20230929211937/https://nuxt.com/docs/api/advanced/hooks
🎤 Nuxt Nation is coming - The largest online Nuxt Conference is happening on October 18-19, 2023.Register

Lifecycle Hooks

App Hooks (runtime)

Check theapp source code for all available hooks.

HookArgumentsEnvironmentDescription
app:createdvueAppServer & ClientCalled when initialvueApp instance is created.
app:errorerrServer & ClientCalled when a fatal error occurs.
app:error:cleared{ redirect? }Server & ClientCalled when a fatal error occurs.
app:data:refreshkeys?Server & Client(internal)
vue:setup-Server & Client(internal)
vue:errorerr, target, infoServer & ClientCalled when a vue error propagates to the root component.Learn More.
app:renderedrenderContextServerCalled when SSR rendering is done.
app:redirected-ServerCalled before SSR redirection.
app:beforeMountvueAppClientCalled before mounting the app, called only on client side.
app:mountedvueAppClientCalled when Vue app is initialized and mounted in browser.
app:suspense:resolveappComponentClientOnSuspense resolved event.
link:prefetchtoClientCalled when a<NuxtLink> is observed to be prefetched.
page:startpageComponent?ClientCalled onSuspense pending event.
page:finishpageComponent?ClientCalled onSuspense resolved event.
page:transition:finishpageComponent?ClientAfter page transitiononAfterLeave event.

Nuxt Hooks (build time)

Check theschema source code for all available hooks.

HookArgumentsDescription
kit:compatibilitycompatibility, issuesAllows extending compatibility checks.
readynuxtCalled after Nuxt initialization, when the Nuxt instance is ready to work.
closenuxtCalled when Nuxt instance is gracefully closing.
restart{ hard?: boolean }To be called to restart the current Nuxt instance.
modules:before-Called during Nuxt initialization, before installing user modules.
modules:done-Called during Nuxt initialization, after installing user modules.
app:resolveappCalled after resolving theapp instance.
app:templatesappCalled duringNuxtApp generation, to allow customizing, modifying or adding new files to the build directory (either virtually or to written to.nuxt).
app:templatesGeneratedappCalled after templates are compiled into thevirtual file system (vfs).
build:before-Called before Nuxt bundle builder.
build:done-Called after Nuxt bundle builder is complete.
build:manifestmanifestCalled during the manifest build by Vite and webpack. This allows customizing the manifest that Nitro will use to render<script> and<link> tags in the final HTML.
builder:generateAppoptionsCalled before generating the app.
builder:watchevent, pathCalled at build time in development when the watcher spots a change to a file or directory in the project.
pages:extendpagesCalled after pages routes are resolved.
server:devHandlerhandlerCalled when the dev middleware is being registered on the Nitro dev server.
imports:sourcespresetsCalled at setup allowing modules to extend sources.
imports:extendimportsCalled at setup allowing modules to extend imports.
imports:contextcontextCalled when theunimport context is created.
imports:dirsdirsAllows extending import directories.
components:dirsdirsCalled withinapp:resolve allowing to extend the directories that are scanned for auto-importable components.
components:extendcomponentsAllows extending new components.
nitro:confignitroConfigCalled before initializing Nitro, allowing customization of Nitro's configuration.
nitro:initnitroCalled after Nitro is initialized, which allows registering Nitro hooks and interacting directly with Nitro.
nitro:build:beforenitroCalled before building the Nitro instance.
nitro:build:public-assetsnitroCalled after copying public assets. Allows modifying public assets before Nitro server is built.
prerender:routesctxAllows extending the routes to be pre-rendered.
build:errorerrorCalled when an error occurs at build time.
prepare:typesoptionsCalled before Nuxi writes.nuxt/tsconfig.json and.nuxt/nuxt.d.ts, allowing addition of custom references and declarations innuxt.d.ts, or directly modifying the options intsconfig.json
listenlistenerServer, listenerCalled when the dev server is loading.
schema:extendschemasAllows extending default schemas.
schema:resolvedschemaAllows extending resolved schema.
schema:beforeWriteschemaCalled before writing the given schema.
schema:written-Called after the schema is written.
vite:extendviteBuildContextAllows to extend Vite default context.
vite:extendConfigviteInlineConfig, envAllows to extend Vite default config.
vite:configResolvedviteInlineConfig, envAllows to read the resolved Vite config.
vite:serverCreatedviteServer, envCalled when the Vite server is created.
vite:compiled-Called after Vite server is compiled.
webpack:configwebpackConfigsCalled before configuring the webpack compiler.
webpack:configResolvedwebpackConfigsAllows to read the resolved webpack config.
webpack:compileoptionsCalled right before compilation.
webpack:compiledoptionsCalled after resources are loaded.
webpack:changeshortPathCalled onchange on WebpackBar.
webpack:error-Called ondone if has errors on WebpackBar.
webpack:done-Called onallDone on WebpackBar.
webpack:progressstatesArrayCalled onprogress on WebpackBar.

Nitro App Hooks (runtime, server-side)

HookArgumentsDescriptionTypes
render:responseresponse, { event }Called before sending the response.response,event
render:htmlhtml, { event }Called before constructing the HTML.html,event
render:islandislandResponse, { event, islandContext }Called before constructing the island HTML.islandResponse,event,islandContext

[8]ページ先頭

©2009-2025 Movatter.jp