when running nuxt generate
, at build time, call order:
- plugins on plugin folder
- page route guard
beforeRouteEnter
- global router middleware
middleware
on page options- page
asyncData
- page legacy deprecated
fetch
- page
beforeCreate
- page data function
- page
created
- page
fetch
hook
then when the page is called on the client when using nuxt start
, call order:
- plugins on plugin folder
- page
beforeRouteEnter
- global router middleware
- page
beforeCreate
- page
data
- page
created
- page
beforeMount
- page
mounted
when there is a client-side navigation (using nuxt-link
), call order:
- from:
beforeRouteLeave
- global
router.middleware
- to:
middleware
- to:
beforeRouteEnter
- from:
beforeDestroy
- from:
destroyed
- to:
beforeCreate
- to:
data
- to:
created
- to:
beforeMount
- to:
mounted
Information generated by this repo on this environment:
➜ nuxt-static-lifecycle node --version
v18.3.0
➜ nuxt-static-lifecycle npm --version
8.5.5