Internal operation mechanism of vue

there are still some things about this picture that we don"t understand. We can see that there are two ways from render function to DOM

.
  1. render function-> getter-> watcher->.-> DOM
  2. render function-> vitual dom tree->.-> DOM

Why is there a second way

Mar.28,2021

render function -> getter-> watcher is to collect dependencies and record the value objects that need to be observed.

normally takes the second path, that is, render function generates a new virtual DOM, and compares it with the existing virtual DOM to find out the differences, and then updates the DOM.

Menu