Vue lifecycle hooks

  • BeforeCreate: Data and event methods are not yet bound to the APP object

=> Bind data and methods to the application object

  • Create: Data and methods are bound to the application object app (but not to the template/view)

Compile template into the render function

  • BeforeMount: DOM objects generated from data are not available before rendering/mounting

= > rendering DOM

  • Mounted: A DOM object is generated after rendering or mounting data
  • BeforeUpdate: Data changes but content has not changed before
  • Updated: The content has been updated
  • BeforeDestroy: Before application destruction
  • Destroyed: After the application is destroyed

Every time a v-if operation is performed, there is a process of re-rendering and deleting

V-show, the update operation is over