V
V
Vitya Podpriklopolny2019-05-08 20:09:22
Design patterns
Vitya Podpriklopolny, 2019-05-08 20:09:22

How does MVVM work in js frameworks?

Good afternoon!
Having got used to vue a little, I wanted to understand how vue itself works (i.e. what it does after creating an instance, etc. I started digging into MVC, MVP, MVVM, how it works, etc.
I saw this in the vue doc


Although Vue does not fully implement the MVVM pattern, the architecture of the framework is largely inspired by it. Therefore, the variable with the Vue instance is traditionally named vm (short for ViewModel).

Kind people! Can you please explain how MVVM works in VUE? That is, what exactly is happening. Where model, view. How many things I have reviewed, re-read, everyone explains these patterns so-so.
So how does MVVM work? Do I need to understand it in order to code properly? If yes, how to understand? Please explain specifically vue framework. What about MVC?
I think that this is a great pain for all beginners, and by writing an answer, you are doing a good deed!) I
sincerely thank everyone who is not indifferent to this issue)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
grinat, 2019-05-08
@megamage

Model -
View methods - template
ViewModel - what is in the data
MVC / MVP
Model -
View methods - template
Presenter / Controller - there would be one that would kick the view and force it to update, or accept data from any inputs and redirect to the model, would receive something from the model and then would kick the
Presenter view - this is a desktop, a controller for the web, the essence is the same.
You don't need to understand to code. From js frameworks, you need to understand something in angular / backbone / nestjs, in vue / react / express all this is not necessary.

A
Alexander Drozdov, 2019-05-08
@bagzon

Simply put, the model, where the data and its processing is in vuex, the display of this data is already in the vue components. Here's MVVM for you

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question