• All instances in which lifecycle hooks are automatically bound to this context are accessible through this.
  1. beforeCreate
  • After instance initialization, data Observe and Event/Watcher events are called before configuration
  1. created
  • Called immediately after instance creation, the instance has completed data observe,property and method operations, and watch/ Event callback. However, the instance has not been mounted, so $EL property is not available
  1. beforeMount
  • Called before mounting, the associated Rander function is called for the first time
  1. mounted
  • Called after the instance is mounted, the VM whose EL is created. El in Mounted if you want the entire view to be rendered, use vm. El in Mounted if you want the entire view to be rendered, use vm
mounted:function(){
  this.$nextTick(function(){
  	
  })
}
Copy the code
  1. beforeUpdate
  • Data update is called and occurs before the virtual DOM is patched. It is suitable for manipulating the DOM before it is updated, and you can manually overflow the added event listeners. It is not called during server-side rendering because only the first rendering takes place on the server side.
  1. updated
  • Data changes cause the virtual DOM to be re-rendered and patched, which is called later. When you walk through this hook, the component DOM is updated and you can now perform operations that depend on the current DOM. Try to avoid this operationThe computed or watchUpdated does not guarantee that all subcomponents will also be redrawn together, if you want to wait until the entire view is redrawn, use vm.$nextTick
  1. activated
  • Called when activated by a component cached by keep-alive
  1. deactivated
  • Deactivating a component cached by keep-alive is called
  1. beforeDestory
  • Called before instance destruction. In this part, the instance is still fully available.
  1. destoryed
  • Called after instance destruction. When this hook is called, all instructions for the corresponding Vue instance are unbound, all event listeners are removed, and all subinstances are destroyed.
  1. errorCaptured
  • Added in 2.5.0. Called when an error from a descendant is caught. Three parameters are received: the error object, the component instance where the error occurred, and one containing information about the source of the error