mvc
mvp
mvvm
With MVVH, all dom operations are operated by vm, which reduces the workload of programmers, and
programmers can spend a lot of time on business logic instead of dom operations
Why doesn't Vue fully comply with MVVM?
Although the original words of the vue official website
did not fully follow the MVVM model, the design of Vue was also inspired by it. Therefore, the variable name vm (short for ViewModel) is often used in the document to represent the Vue instance.
reason:
- Vue provides an attribute: ref, through which the DOM object can be obtained, and the view can be directly manipulated through the ref. At this point, it violates mvvm;
- When creating a new Vue instance, data needs to be transferred, which is the vm view model layer, which covers the data layer