Vue initialization process

Vue initialization process

The Vue initialization process starts with new vue(), as can be seen from the following figure. After new vue(), init will be executed, then $mount will be mounted, and then compile will be compiled to generate the render function, followed by responsive dependency collection and asynchronous update through Pach. Render function will be transformed into a vnode node. Virtual DOM is a tree based on JavaScript objects (vnode nodes). Is a description of the real dom. Convert to true DOM through patch(). When the data changes, it will pass setter - & gt; Watcher -> Update to update the view. The operation mechanism of the whole Vue is roughly like this. The process from creation to destruction of Vue instances is the life cycle. The life cycle of Vue starts from creating, initializing data, compiling templates, mounting DOM → rendering, updating → rendering and unloading.
25