Lightweight responsive framework based on MVVM pattern—Vue

With the development of Web2.0 and the advent of the mobile Internet era, front-end development has become more and more important in the development of the entire Web application software. More and more data processing and business logic in the current Web system are beginning to lean toward the front end, gradually forming a "big front end" situation, and the front end has higher and higher requirements for performance and development efficiency. If you do not change your mind and still use the traditional method at this time, it will undoubtedly affect the front-end development speed and later maintenance will become difficult. At present, there are many excellent front-end frameworks on the market that have solved the above problems. Vue is such an excellent framework. It introduces in detail the lightweight responsive framework based on the MVVM pattern—Vue.
2.1.1 MVX framework
A variety of different architectures have appeared in the front-end development process. Here are three types of MVX architectures:
(1) MVC architecture: MVC architecture consists of Model (model) layer and View (view) layer , Controller (controller) layer composition, it is a model of software design, using a method of separation of business logic, data, interface display to organize the code [11], through a layered way, separate responsibilities from each other, so that the system The code is clear and easy to maintain.
(2) MVP architecture: MVP architecture evolved from MVC. The same point is that Controller/Presenter is responsible for logic processing, Model provides data, and View is responsible for page display. The difference is that the View in the MVP architecture does not use the Model directly, but through the Presenter (Controller in the MVC architecture). However, in the MVC architecture, the View can directly read data from the Model and does not need to be indirectly obtained through the Controller. data.
(3) MVVM architecture: The MVVM architecture replaces the Controller in MVC and Presenter in MVP with ViewModel. In the MVVM architecture, View (view) and Model (data), like the MVP architecture, cannot directly interact with information. ViewModel is the bridge between the two. So the way of information interaction at this time is: when the View changes, the ViewModel perceives the change, and then informs the Model of the corresponding change. On the contrary, when the Model changes,

The ViewModel can perceive the corresponding changes, and then notify the View to update the view. This is the well-known concept of two-way binding.

Guess you like

Origin blog.csdn.net/qq_42918433/article/details/113881263