04-mvvm understanding in vue

Insert picture description here

The view layer
is usually the DOM layer in our front-end development.
The main function is to show all kinds of information to users.
Model layer:

The
data of the model layer may be our fixed dead data, and more are the data requested from our server and from the Internet.
In the case of our counter, it is the obj extracted later. Of course, the data inside may not be so simple.
VueModel layer:

ViewModel layer The
view model layer is the bridge between View and Model.
On the one hand, it implements DataBinding, that is, data binding, and reacts the changes of Model to the View in real time.
On the other hand, it implements DOM Listener, which is DOM monitoring. When some events (click, scroll, touch, etc.) occur in the DOM, When it is time, it can be monitored and the corresponding Data can be changed if necessary.

Example:

Reference counter case code
Insert picture description here

Guess you like

Origin blog.csdn.net/plan_jok/article/details/112860578