Understanding the Vue.js lifecycle and hooks
As we progress into the book, our knowledge of Vue.js continues to expand. In this section, we are going to discuss the Vue.js lifecycle.
When we use Vue.js, the application goes through a defined list of steps, from creating the component HTML to gathering all the dynamic values, as well as displaying these values in the DOM. Each of these is part of what we call the lifecycle, and in this section, we are going to define them all and learn when and how to use them during the course of our development careers.
If you have ever tried to learn Vue.js in the past, you have probably already been exposed to the following diagram, which is available in the main Vue.js documentation:
Figure 2.3: Vue.js lifecycle diagram (from www.vuejs.org)
No matter how long you have been using Vue.js, the preceding diagram will repeatedly appear in your browser history, and it will slowly be imprinted in your memory, as it...