in VueJS by (793 points)
How is the virtual DOM works in Vue js and how is it beneficial?

1 Answer

0 votes
by (793 points)
The virtual DOM is a tree-like data structure (or a collection) of JavaScript objects representing DOM nodes that are managed by Vue.js and that should be rendered on the page. These objects are called “virtual nodes” or VNodes for short.

The main purpose of the virtual DOM is faster and more efficient DOM manipulation. When there are lots of nodes in the DOM, updating them can be expensive in terms of processing power and resources required.

Working with the virtual DOM JavaScript object is significantly faster. Subsequently, Vue.js organizes DOM updates in batches for more efficiency.

Related questions

0 votes
asked Oct 9, 2019 in VueJS by Indian (793 points)