Instance lifecycle hooks:
1.beforeCreate
2.Created
3.beforeMount
4.mounted
5.beforeUpdate
6.updated
7.befroeDestory
8.destroyed
Var vm =new Vue () creates an instance object of Vue;
A Vue empty instance object has just been initialized. At this point, only some default lifecycle functions and default events have been created on this object, and nothing else has been created
BeforeCreate: When the beforeCreate life cycle function is executed, the data in data and methods are not initialized
Created: In Created, data and methods are already initialized. If you want to call methods in methods or manipulate data in data, you can only do it in Created
BeforeMount: This function is executed when the template is compiled in memory but not loaded into the page, the page is still old
Mounted: When mounted is executed, the Vue instance is initialized. When mounted is executed, the Vue instance is initialized
BeforeUpdate: When you run beforeUpdate, the data displayed on the page is still the latest data and the page has not been synchronized with the latest data
Updated: Updated When the event is executed, the page and data have been synchronized and are up to date
BefroeDestory: When the befroeDestory hook function is executed, the vue instance has moved from the run phase to the destroy phase, with all data and methods on the body, and the instruction…… Are available, and at this point, there is no actual destruction process
Destroyed: All data, methods, and instructions in the component…… are destroyed when the component is destroyed They’re not available anymore