Posted at

Vue.js と Nuxt.js のライフサイクル早引きメモ

More than 1 year has passed since last update.


Vue.js


Lifecycle


Lifecycle, in case with SSR


Since there are no dynamic updates, of all the lifecycle hooks, only beforeCreate and created will be called during SSR. This means any code inside other lifecycle hooks such as beforeMount or mounted will only be executed on the client.



Nuxt.js


Middlewares, the big picture


Lifecycle hooks, the big picture


According to this diagram, the hooks happen in this order: nuxtServerInit, middleware, and then fetch and asyncData.