1. Define some methods in methods.

1, when is a method: the method is called method, generally defined in the class, which is defined in the need to call the function method. For example, in new Vue ({}). Function add ({}) = function add ({}); External function definitions

Second, vUE life cycle: from a birth to destruction of such a process. , will be automatically called according to the cycle.

Created (){create (){create ();

Mounted () {return () {return ();

BeforeCreadted vue instance mount element $EL and data object data are undefined, not initialized. Add loading events

Created vue instance data object data, $el is not finished loading, request data preparation for mounted rendering

BeforeMount vue instance $EL and data are initialized, but are still virtual DOM nodes. The data.filter is not replaced. .

Mounted Vue instance is mounted. Data. filter is successfully displayed and used with routing hooks

BeforeUpdate Trigger when data is updated

Updated data (watch can also be used here)

BeforeDestroy Trigger when component is destroyed

The vue instance removes the event listener and is unbound to the DOM (no response), but the DOM node still displays a message when the component is destroyed



ES modular import and export P75-00:57