vue virtual DOM What are the benefits?

vue virtual DOM What are the benefits? fast!

First understand the browser displays the web page experienced five process 

1, resolution tag generates an element tree (DOM Tree)

2, analytical style generation pattern tree

3, the relationship between the elements and generate style

4, to generate the original display coordinates

5, page display

 

Modify true DOM

Each modify an element, then this 5 process should go once again. Modify elements 10 and left 10 times.

 

Modifying the virtual DOM

DOM virtual storage, modification of 10 elements is performed in memory in a virtual DOM, after modification, comparison between real and virtual DOM DOM, and when there are differences, once again last update Web page display, instead of walking 10 over the process.

 

Virtual DOM Benefits

Fast page rendering process reduces the number of times

Guess you like

Origin www.cnblogs.com/anyjs/p/11627277.html