* What is the lifecycle?












8

* What is the role of the VUE lifecycle?



Lifecycle hook

* Which hooks are triggered the first time the page loads?


  • | – beforeCreate instance has just been created, after instance initialization, data configuration before observation and events
  • | – created the instance creation is immediately after the completion of the call. In this step, the instance completes the configuration of data Observer, property and method operations, and Watch/Event event callbacks. However, the mount phase has not yet started and the $EL attribute is not currently visible
  • |- beforeMount (This hook is not called during server-side rendering.)

    Before the template is compiled and mounted, the HTML interface is not generated and called before the mount begins: the associated render function is called for the first time.
  • |- activated (This hook is not called during server-side rendering.)

    Called when the keep-alive component is activated (only called when the keep-alive component is activated)
  • |- mounted (This hook is not called during server-side rendering.)

    The template has been mounted (DOM rendering is done in Mounted). This hook is not called during server-side rendering.

* Which scenarios are appropriate for each cycle?















* Created and Mounted











* Vue gets data in which periodic function?