Virtual DOM

The result of the render function is a tree of nodes created with the createElement (or h) function; these are called VNodes in Vue. It represent the view of the component in the Virtual DOM held by Vue. Every element in the DOM is a node--HTML elements, text, even comments are nodes:

Vue doesn't directly replace the Real DOM tree with the new Virtual DOM tree, because it may engender a lot of DOM operations (add or remove nodes), which are costly. To be more performant, Vue will create a diff between the two trees, and it will only do the DOM operations necessary to update the Real DOM to match the Virtual DOM.

All of this happens automatically so that Vue keeps the Real DOM up-to-date when data changes in your application.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.17.64.47