Briefly describe the Vue life cycle

1. Life cycle method during creation

  beforeCreate : Method characteristics-the data and methods in the Vue instance are not initialized when calling. That is, the data and methods of the Vue instance cannot be called when this method is called.

  created : -is the first place where we can access the data and methods saved in the Vue instance.

  beforeMount : -means that Vue has compiled the final template, but has not yet rendered the final template to the interface.

  mounted :——It means that Vue has finished rendering the template, which means that we can get the rendered content on the interface.

2. Life cycle method during operation

  beforeUpdate : -indicates that the data saved in the Vue instance has been modified. At this time the interface has not been modified.
       Note: BeforeUpdate will be called only if the saved data is modified, otherwise it will not be called.
       When beforeUpdate is called, the data has been updated, but the interface has not been updated.

   updated :-updated will be called after the data and interface are updated synchronously

3. Life cycle method during destruction

  beforeDestroy : Indicates that the current component is about to be destroyed.
       Note: As long as the component is not destroyed, beforeDestroy will not be called

  beforeDestroy: Function is the last function we can access to component data and methods

  Destroyed : ——Indicates that the current component has been destroyed.
       Note: As long as the component is not destroyed, then destroyed will not be called.
       Do not operate the data and methods in the component in this life cycle method.

 

Life cycle diagram, official website has

 

 

Reprinted: https://blog.csdn.net/cao_mary/article/details/107234599

Guess you like

Origin blog.csdn.net/wanghongpu9305/article/details/113408421