Please detail your understanding of vue at the life cycle?

There are four main stages: After you create before / DOM rendering before / after update before / after the destruction before / after.

For the understanding of each cycle: 
before creating / rear: 
beforeCreated: vue examples also in this case the element is not mounted $el, the object data are data undefiend; ($ EL no, no data)
Created: vue data object instance data there, but $elno (no $ el, existing data)
before loading / after: 
beforeMount: $ EL and data instances are initialized vue, but still mounted in a virtual DOM node before the above, data.message has not been replaced 
mounted : vue example of the mount is completed, data.message successfully rendered. 
Before updating / rear 
when the data changes, it will trigger beforeUpdate and updated methods. 
Destruction before / after: 
After destiory, changes to the data are no longer trigger periodic function, examples illustrate this point vue been unbound and event listeners and dom, but in accordance with dom
 

Guess you like

Origin www.cnblogs.com/sunww/p/11282985.html