Lifecycle hooks

We have access to a variety of lifecycle hooks that fire at particular points during the creation of our Vue instance. These hooks range from prior to creation with beforeCreate, to after the instance is mounted, destroyed, and many more in between.

As the following figure shows, the creation of a new Vue instance fires off functions at varying stages of the instance lifecycle.

We'll be looking at how we can activate these hooks within this section:

Vue.js instance lifecycle hooks

Taking advantage of the lifecycle hooks (https://vuejs.org/v2/guide/instance.html) can be done in a similar way to any other property on our Vue ...

Get Vue.js 2 Design Patterns and Best Practices now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.