life cycle
beforeCreate
This hook function only initializes the event and life cycle. If the data obtained here is an undefined
initEvent, add the event attribute
initLifecycle to vm: initialize the empty attribute of vm.$options
initRender: initialize the attribute required for virtual dom
beforeCreate template has not yet is replaced.
create
initInjections(vm);
initState(vm);
1. The data of data is initialized here initData()
2. Let the data of data become responsive observe() and proxy();
3. Determine whether it is newly added or not Array, is not object
initProvide(vm);
callHook(vm, 'created');
The code after create; replace {
{}} with data
$mount method
return mount.call(this, el, hydrating) and jump to this method
Follow the moutComponent to enter beforeMount and mount what cycle
beforeMount