Xpress front-end life cycle in mind --------- vuejs

     Attachment: 

2019-09-10 You will leave life even more beautiful than entered it. Ending life will be more beautiful than the beginning>

Vue.js instance life cycle:

  init:

  Synchronous call at the instance starts initialization, data at the moment none of the observed events and initialization. 2.0 renamed beforeCreate.

  created:

  After the instance is created called, now it has completed the data binding, event methods. But not yet begun compiling DOM, that is not mounted to the document

  beforeComplie:

  Called before DOM compilation. 2.0 abandoned the method recommended create.

  beforeMount:

  2.0 The new lifecycle hook runs before mounted.

  complied:

  Call at the end of compilation. At this point all instructions in force, data changes can trigger DOM has been updated, but does not guarantee $ el has been inserted into the document. 2.0 renamed mounted.

  ready:

  After compiling the end of the call and $ el first inserted into the document. 2.0 abandoned the method recommended mounted. This change is already ready to change the life cycle state, the equivalent of the canceled document is inserted after the first $ el hook function.

  attached:

  . $ El called vm is inserted into the DOM, ready calls after the first attched, operating instructions, or $ el must use the instance method, direct manipulation vm. $ El does not trigger hook. 2.0 abandoned this usage, it is recommended to check whether a custom mounted in the other hooks.

  detached:

  With attached similar to the hook. $ Vm call from the DOM is removed vm, and must be a command or an instance method. Also this method 2.0 discarded.

  beforeDestroy:

  At the beginning of the destruction instance call, the moment is still valid instance.

  destroyed:

  After calling instance is destroyed, and now all bound instances instructions have been unbundling, the child instance is also destroyed.

  beforeUodate:

  2.0 The new lifecycle hook, after the example of the mount, will update the instance when the method is called again, this time has not been updated DOM structure.

  uodated:

  2.0 The new lifecycle hook, after the example of the mount, called again after the update instances and update the DOM structure.

   activated:

  2.0 The new lifecycle hook, need to meet the dynamic component keep-live property use. This method is called during dynamic rendering of the component initialization.

  deactivated:

  2.0 The new lifecycle hook, need to meet the dynamic component keep-live property use. The method is called out during the dynamic component.

 

 Lifecycle icon

 

 

 

 

Guess you like

Origin www.cnblogs.com/hudunyu/p/11495177.html