About vue in the periodic function

vue in the life cycle of a function periodic function = = = hook lifecycle lifecycle events that white after is to create an instance of the object, and the event runs from the creation of the destruction that occurred:

What is the life cycle: the process will run a variety of events accompanied by the destruction of vue create instances from these events collectively referred to as a periodic function

1. Create a periodic function of period:

beforecreate (): instance just create it in memory, this time not initialized good data attributes and methods

created (): instance has been created in memory, this time data and methods have been ok, this time has not been compiled template

beforemount (): This completes the compilation of templates, but have not mounted to the page

mounted (): the compiled template to mount the container specified page display

2. During the period of operation of the function:

Prior to this update execution state function, then the state value data is up to date, but the value of the page is old, because at this time has not yet rendered dom node: beforeUpdate ()

updated (): This function is executed after the updated instance, the data at this time a new page is updated data, the interface has been rendered well

3. Destruction periodic function of period:

beforeDestroy (): function is performed before the destruction of example, this time data can be used, and methods

destroyed (): After the call, everything will de-vue instance tie, all listening events are removed, all the child instance will be destroyed

 

 

Guess you like

Origin www.cnblogs.com/xiaoxingrui520/p/12142916.html